diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index dd4f4c31217be710df2ec9f140b2cb1600ef5650..ea9d0b10226e0c68f52ba327e38828a15f3eff6b 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -2760,9 +2760,9 @@ JamiAccount::setIsComposing(const std::string& conversationUri, bool isWriting) if (auto cm = convModule(true)) { if (auto typer = cm->getTypers(conversationId)) { if (isWriting) - typer->addTyper(getUsername()); + typer->addTyper(getUsername(), true); else - typer->removeTyper(getUsername()); + typer->removeTyper(getUsername(), true); } } } diff --git a/src/jamidht/typers.cpp b/src/jamidht/typers.cpp index 71c9538770ae87740cbb79c057a4962c5d93b38b..0cc71584ca41cb6bee89919eba1739758d4852e8 100644 --- a/src/jamidht/typers.cpp +++ b/src/jamidht/typers.cpp @@ -76,7 +76,6 @@ Typers::addTyper(const std::string &typer, bool sendMessage) convId_, typer, 1); - return; } if (sendMessage) { // In this case we should emit for remote to update the timer diff --git a/test/unitTest/conversation/conversation.cpp b/test/unitTest/conversation/conversation.cpp index 69cf03cf1a6904eb0f6ae0b6b3cb45182f7e85ab..1fc3690f8b4bfb429b888b68be457d8a49b78454 100644 --- a/test/unitTest/conversation/conversation.cpp +++ b/test/unitTest/conversation/conversation.cpp @@ -64,7 +64,6 @@ struct UserData { bool registered {false}; bool stopped {false}; bool deviceAnnounced {false}; - bool composing {false}; bool sending {false}; bool sent {false}; bool searchFinished {false}; @@ -120,7 +119,6 @@ private: void testMergeTwoDifferentHeads(); void testSendMessageToMultipleParticipants(); void testPingPongMessages(); - void testIsComposing(); void testSetMessageDisplayedTwice(); void testSetMessageDisplayedPreference(); void testSetMessageDisplayedAfterClone(); @@ -174,7 +172,6 @@ private: CPPUNIT_TEST(testMergeTwoDifferentHeads); CPPUNIT_TEST(testSendMessageToMultipleParticipants); CPPUNIT_TEST(testPingPongMessages); - CPPUNIT_TEST(testIsComposing); CPPUNIT_TEST(testSetMessageDisplayedTwice); CPPUNIT_TEST(testSetMessageDisplayedPreference); CPPUNIT_TEST(testSetMessageDisplayedAfterClone); @@ -409,17 +406,6 @@ ConversationTest::connectSignals() carlaData.errorDetected = true; cv.notify_one(); })); - confHandlers.insert( - libjami::exportable_callback<libjami::ConfigurationSignal::ComposingStatusChanged>( - [&](const std::string& accountId, - const std::string& /*conversationId*/, - const std::string& /*peer*/, - bool state) { - if (accountId == bobId) { - bobData.composing = state; - } - cv.notify_one(); - })); confHandlers.insert( libjami::exportable_callback<libjami::ConfigurationSignal::AccountMessageStatusChanged>( [&](const std::string& accountId, @@ -958,36 +944,6 @@ ConversationTest::testPingPongMessages() })); } -void -ConversationTest::testIsComposing() -{ - std::cout << "\nRunning test: " << __func__ << std::endl; - connectSignals(); - - auto aliceAccount = Manager::instance().getAccount<JamiAccount>(aliceId); - auto bobAccount = Manager::instance().getAccount<JamiAccount>(bobId); - auto bobUri = bobAccount->getUsername(); - auto convId = libjami::startConversation(aliceId); - auto aliceMsgSize = aliceData.messages.size(); - libjami::addConversationMember(aliceId, convId, bobUri); - CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return aliceMsgSize + 1 == aliceData.messages.size(); })); - // Assert that repository exists - auto repoPath = fileutils::get_data_dir() / aliceId - / "conversations" / convId; - CPPUNIT_ASSERT(std::filesystem::is_directory(repoPath)); - // Check created files - auto bobInvited = repoPath / "invited" / bobUri; - CPPUNIT_ASSERT(std::filesystem::is_regular_file(bobInvited)); - CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return bobData.requestReceived; })); - libjami::acceptConversationRequest(bobId, convId); - CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return aliceMsgSize + 2 == aliceData.messages.size(); })); - - aliceAccount->setIsComposing("swarm:" + convId, true); - CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return bobData.composing; })); - aliceAccount->setIsComposing("swarm:" + convId, false); - CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return !bobData.composing; })); -} - void ConversationTest::testSetMessageDisplayedTwice() {