Commit 95d2df43 authored by Benjamin REIS's avatar Benjamin REIS

fix last notify id when chat room is left

parent 8efc6e41
...@@ -533,6 +533,7 @@ void ClientGroupChatRoom::onConferenceKeywordsChanged (const vector<string> &key ...@@ -533,6 +533,7 @@ void ClientGroupChatRoom::onConferenceKeywordsChanged (const vector<string> &key
void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) { void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) {
L_D(); L_D();
L_D_T(RemoteConference, dConference); L_D_T(RemoteConference, dConference);
dConference->eventHandler->unsubscribe(); dConference->eventHandler->unsubscribe();
dConference->eventHandler->resetLastNotify(); dConference->eventHandler->resetLastNotify();
d->setState(ChatRoom::State::Terminated); d->setState(ChatRoom::State::Terminated);
......
...@@ -706,7 +706,7 @@ long long MainDbPrivate::insertConferenceEvent (const shared_ptr<EventLog> &even ...@@ -706,7 +706,7 @@ long long MainDbPrivate::insertConferenceEvent (const shared_ptr<EventLog> &even
soci::use(curChatRoomId); soci::use(curChatRoomId);
if (eventLog->getType() == EventLog::Type::ConferenceTerminated) 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) if (chatRoomId)
......
...@@ -1544,6 +1544,7 @@ static void group_chat_room_reinvited_after_removed_base (bool_t offline_when_re ...@@ -1544,6 +1544,7 @@ static void group_chat_room_reinvited_after_removed_base (bool_t offline_when_re
} }
if (!offline_when_reinvited) if (!offline_when_reinvited)
BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateTerminated, initialLaureStats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); 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); wait_for_list(coresList,0, 1, 2000);
initialLaureStats = laure->stat; initialLaureStats = laure->stat;
...@@ -3491,7 +3492,7 @@ test_t group_chat_tests[] = { ...@@ -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_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", 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 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("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), 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 // TODO: Use when we support adding a new device in created conf
...@@ -3508,7 +3509,7 @@ test_t group_chat_tests[] = { ...@@ -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", 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_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("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("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("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), TEST_NO_TAG("IMDN for group chat room", imdn_for_group_chat_room),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment