Commit b4dbb794 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed missing subscribe after exhuming a chat room

parent b27a3676
......@@ -830,6 +830,11 @@ void ClientGroupChatRoomPrivate::onLocallyExhumedConference (const Address &remo
q->setState(ConferenceInterface::State::Created);
static_pointer_cast<RemoteConference>(q->getConference())->eventHandler->unsubscribe(); // Required for next subscribe to be sent
q->getConference()->setLastNotify(0);
q->getCore()->getPrivate()->remoteListEventHandler->addHandler(static_pointer_cast<RemoteConference>(q->getConference())->eventHandler.get());
static_pointer_cast<RemoteConference>(q->getConference())->eventHandler->subscribe(q->getConferenceId());
lInfo() << "Found " << pendingExhumeMessages.size() << " messages waiting for exhume";
for (auto &chatMessage : pendingExhumeMessages) {
chatMessage->getPrivate()->setChatRoom(q->getSharedFromThis());
......
......@@ -2492,6 +2492,12 @@ static void exhume_group_chat_lime_x3dh_one_to_one_chat_room_base_1(const int cu
if (marieOneToOneCr) {
int marie_messages = linphone_chat_room_get_history_size(marieOneToOneCr);
BC_ASSERT_EQUAL(marie_messages, 1, int , "%d");
LinphoneChatMessage *exhume_answer_message = linphone_chat_room_create_message_from_utf8(marieOneToOneCr, "Nooooooooooooo !");
linphone_chat_message_send(exhume_answer_message);
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneMessageSent, 1, 5000));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, 1, 5000));
linphone_chat_message_unref(exhume_answer_message);
}
}
......@@ -2601,6 +2607,12 @@ static void exhume_group_chat_lime_x3dh_one_to_one_chat_room_base_2(const int cu
if (paulineOneToOneCr2) {
int pauline_messages = linphone_chat_room_get_history_size(paulineOneToOneCr2);
BC_ASSERT_EQUAL(pauline_messages, 2, int , "%d");
LinphoneChatMessage *exhume_answer_message = linphone_chat_room_create_message_from_utf8(paulineOneToOneCr2, "Your focus determines your reality.");
linphone_chat_message_send(exhume_answer_message);
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageSent, 2, 5000));
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneMessageReceived, 2, 5000));
linphone_chat_message_unref(exhume_answer_message);
}
}
......@@ -2849,6 +2861,12 @@ static void exhume_group_chat_lime_x3dh_one_to_one_chat_room_base_4(const int cu
if (marieOneToOneCr) {
int marie_messages = linphone_chat_room_get_history_size(marieOneToOneCr);
BC_ASSERT_EQUAL(marie_messages, 1, int , "%d");
LinphoneChatMessage *exhume_answer_message = linphone_chat_room_create_message_from_utf8(marieOneToOneCr, "In my experience there is no such thing as luck.");
linphone_chat_message_send(exhume_answer_message);
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneMessageSent, 1, 5000));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, 1, 5000));
linphone_chat_message_unref(exhume_answer_message);
}
}
......
......@@ -4361,6 +4361,12 @@ static void exhume_one_to_one_chat_room_1(void) {
if (marieOneToOneCr) {
int marie_messages = linphone_chat_room_get_history_size(marieOneToOneCr);
BC_ASSERT_EQUAL(marie_messages, 1, int , "%d");
LinphoneChatMessage *exhume_answer_message = linphone_chat_room_create_message_from_utf8(marieOneToOneCr, "Nooooooooooooo !");
linphone_chat_message_send(exhume_answer_message);
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneMessageSent, 1, 5000));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, 1, 5000));
linphone_chat_message_unref(exhume_answer_message);
}
}
......@@ -4460,6 +4466,12 @@ static void exhume_one_to_one_chat_room_2(void) {
if (paulineOneToOneCr2) {
int pauline_messages = linphone_chat_room_get_history_size(paulineOneToOneCr2);
BC_ASSERT_EQUAL(pauline_messages, 2, int , "%d");
LinphoneChatMessage *exhume_answer_message = linphone_chat_room_create_message_from_utf8(paulineOneToOneCr2, "Your focus determines your reality.");
linphone_chat_message_send(exhume_answer_message);
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageSent, 2, 5000));
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneMessageReceived, 2, 5000));
linphone_chat_message_unref(exhume_answer_message);
}
}
......@@ -4780,6 +4792,12 @@ static void exhume_one_to_one_chat_room_4(void) {
if (marieOneToOneCr) {
int marie_messages = linphone_chat_room_get_history_size(marieOneToOneCr);
BC_ASSERT_EQUAL(marie_messages, 1, int , "%d");
LinphoneChatMessage *exhume_answer_message = linphone_chat_room_create_message_from_utf8(marieOneToOneCr, "In my experience there is no such thing as luck.");
linphone_chat_message_send(exhume_answer_message);
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneMessageSent, 1, 5000));
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, 1, 5000));
linphone_chat_message_unref(exhume_answer_message);
}
}
......
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