From 95d2df43fb4932e3f65e6476977706e11b9c492f Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 20 Apr 2018 15:29:18 +0200 Subject: [PATCH] fix last notify id when chat room is left --- src/chat/chat-room/client-group-chat-room.cpp | 1 + src/db/main-db.cpp | 2 +- tester/group_chat_tester.c | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index 66d08c576..d9dbe0039 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -533,6 +533,7 @@ void ClientGroupChatRoom::onConferenceKeywordsChanged (const vector &key void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) { L_D(); L_D_T(RemoteConference, dConference); + dConference->eventHandler->unsubscribe(); dConference->eventHandler->resetLastNotify(); d->setState(ChatRoom::State::Terminated); diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 45aeb0251..655b56cee 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -706,7 +706,7 @@ long long MainDbPrivate::insertConferenceEvent (const shared_ptr &even soci::use(curChatRoomId); if (eventLog->getType() == EventLog::Type::ConferenceTerminated) - *session << "UPDATE chat_room SET flags = 1 WHERE id = :chatRoomId", soci::use(curChatRoomId); + *session << "UPDATE chat_room SET flags = 1, last_notify_id = 0 WHERE id = :chatRoomId", soci::use(curChatRoomId); } if (chatRoomId) diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c index 2569a12d4..8291a6f9b 100644 --- a/tester/group_chat_tester.c +++ b/tester/group_chat_tester.c @@ -1544,6 +1544,7 @@ static void group_chat_room_reinvited_after_removed_base (bool_t offline_when_re } if (!offline_when_reinvited) BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateTerminated, initialLaureStats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); + wait_for_list(coresList,0, 1, 2000); initialLaureStats = laure->stat; @@ -3491,7 +3492,7 @@ test_t group_chat_tests[] = { TEST_NO_TAG("Reinvited after removed from group chat room", group_chat_room_reinvited_after_removed), TEST_ONE_TAG("Reinvited after removed from group chat room while offline", group_chat_room_reinvited_after_removed_while_offline, "LeaksMemory"), TEST_ONE_TAG("Reinvited after removed from group chat room while offline 2", group_chat_room_reinvited_after_removed_while_offline_2, "LeaksMemory"), - TEST_ONE_TAG("Reinvited after removed from group chat room with several devices", group_chat_room_reinvited_after_removed_with_several_devices, "LeaksMemory"), + TEST_NO_TAG("Reinvited after removed from group chat room with several devices", group_chat_room_reinvited_after_removed_with_several_devices), TEST_NO_TAG("Notify after disconnection", group_chat_room_notify_after_disconnection), TEST_NO_TAG("Send refer to all participants devices", group_chat_room_send_refer_to_all_devices), // TODO: Use when we support adding a new device in created conf @@ -3508,7 +3509,7 @@ test_t group_chat_tests[] = { TEST_NO_TAG("Unique one-to-one chatroom", group_chat_room_unique_one_to_one_chat_room), TEST_NO_TAG("Unique one-to-one chatroom recreated from message", group_chat_room_unique_one_to_one_chat_room_recreated_from_message), TEST_ONE_TAG("Unique one-to-one chatroom recreated from message with app restart", group_chat_room_unique_one_to_one_chat_room_recreated_from_message_with_app_restart, "LeaksMemory"), - TEST_ONE_TAG("Join one-to-one chat room with a new device", group_chat_room_join_one_to_one_chat_room_with_a_new_device, "LeaksMemory"), + TEST_NO_TAG("Join one-to-one chat room with a new device", group_chat_room_join_one_to_one_chat_room_with_a_new_device), TEST_NO_TAG("New unique one-to-one chatroom after both participants left", group_chat_room_new_unique_one_to_one_chat_room_after_both_participants_left), TEST_NO_TAG("Unique one-to-one chatroom re-created from the party that deleted it, with inactive devices", group_chat_room_unique_one_to_one_chat_room_recreated_from_message_2), TEST_NO_TAG("IMDN for group chat room", imdn_for_group_chat_room),