mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
conversationRequest: fix testRemoveConversationRemoveSyncing
acceptTrustRequest will set the conversation as ready. removeConversation should be done after Change-Id: I966cc2142d00bda880d63f11c52c36faceb11aa7
This commit is contained in:
@ -880,7 +880,8 @@ ConversationRequestTest::testRemoveConversationRemoveSyncing()
|
||||
std::unique_lock<std::mutex> lk {mtx};
|
||||
std::condition_variable cv;
|
||||
std::map<std::string, std::shared_ptr<DRing::CallbackWrapperBase>> confHandlers;
|
||||
bool conversationReady = false, requestReceived = false, conversationRemoved = false;
|
||||
bool conversationReady = false, contactAdded = false, requestReceived = false,
|
||||
conversationRemoved = false;
|
||||
std::string convId = "";
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConfigurationSignal::IncomingTrustRequest>(
|
||||
[&](const std::string& account_id,
|
||||
@ -908,6 +909,13 @@ ConversationRequestTest::testRemoveConversationRemoveSyncing()
|
||||
}
|
||||
cv.notify_one();
|
||||
}));
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConfigurationSignal::ContactAdded>(
|
||||
[&](const std::string& accountId, const std::string& uri, bool confirmed) {
|
||||
if (accountId == bobId && uri == aliceUri) {
|
||||
contactAdded = true;
|
||||
}
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
aliceAccount->addContact(bobUri);
|
||||
aliceAccount->sendTrustRequest(bobUri, {});
|
||||
@ -915,6 +923,8 @@ ConversationRequestTest::testRemoveConversationRemoveSyncing()
|
||||
|
||||
Manager::instance().sendRegister(aliceId, false); // This avoid to sync immediately
|
||||
CPPUNIT_ASSERT(bobAccount->acceptTrustRequest(aliceUri));
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return contactAdded; }));
|
||||
// At this point the conversation should be there and syncing.
|
||||
|
||||
CPPUNIT_ASSERT(DRing::getConversations(bobId).size() == 1);
|
||||
DRing::removeConversation(bobId, convId);
|
||||
|
Reference in New Issue
Block a user