diff --git a/test/unitTest/syncHistory/syncHistory.cpp b/test/unitTest/syncHistory/syncHistory.cpp index 6c1a7fbc121b381ce9ee3f9b858ad263f5c940ed..7c2d52469c50140936c0bd4d3ff56766aac11602 100644 --- a/test/unitTest/syncHistory/syncHistory.cpp +++ b/test/unitTest/syncHistory/syncHistory.cpp @@ -1052,12 +1052,14 @@ SyncHistoryTest::testLastInteractionAfterClone() auto messageReceived = false; std::string msgId = ""; confHandlers.insert(libjami::exportable_callback<libjami::ConversationSignal::MessageReceived>( - [&](const std::string& /* accountId */, + [&](const std::string& accountId , const std::string& /* conversationId */, std::map<std::string, std::string> message) { - messageReceived = true; - msgId = message["id"]; - cv.notify_one(); + if (accountId == bobId) { + messageReceived = true; + msgId = message["id"]; + cv.notify_one(); + } })); auto conversationReady = false; confHandlers.insert(libjami::exportable_callback<libjami::ConversationSignal::ConversationReady>( @@ -1081,12 +1083,12 @@ SyncHistoryTest::testLastInteractionAfterClone() auto messageDisplayed = false; confHandlers.insert( libjami::exportable_callback<libjami::ConfigurationSignal::AccountMessageStatusChanged>( - [&](const std::string& /* accountId */, + [&](const std::string& accountId, const std::string& /* conversationId */, const std::string& /* username */, const std::string& /* msgId */, int status) { - if (status == 3) + if (bobId == accountId && status == 3) messageDisplayed = true; cv.notify_one(); }));