Commit 560842b5 authored by Ghislain MARY's avatar Ghislain MARY

Add TerminationFailed state to ChatRoom.

parent fdfcbbc1
......@@ -27,9 +27,10 @@
F(Instantiated) \
F(CreationPending) \
F(Created) \
F(CreationFailed) \
F(TerminationPending) \
F(Terminated) \
F(CreationFailed) \
F(TerminationFailed) \
F(Deleted)
#define L_ENUM_VALUES_CHAT_ROOM_CAPABILITIES(F) \
......
......@@ -147,8 +147,14 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged (
qConference->getPrivate()->focus->getPrivate()->getSession()->terminate();
} else if ((newState == CallSession::State::Released) && (q->getState() == ChatRoom::State::TerminationPending)) {
q->onConferenceTerminated(q->getConferenceAddress());
} else if ((newState == CallSession::State::Error) && (q->getState() == ChatRoom::State::CreationPending)) {
setState(ChatRoom::State::CreationFailed);
} else if (newState == CallSession::State::Error) {
if (q->getState() == ChatRoom::State::CreationPending)
setState(ChatRoom::State::CreationFailed);
else if (q->getState() == ChatRoom::State::TerminationPending) {
// Go to state TerminationFailed and then back to Created since it has not been terminated
setState(ChatRoom::State::TerminationFailed);
setState(ChatRoom::State::Created);
}
}
}
......
......@@ -74,14 +74,17 @@ static void chat_room_state_changed (LinphoneChatRoom *cr, LinphoneChatRoomState
case LinphoneChatRoomStateCreated:
manager->stat.number_of_LinphoneChatRoomStateCreated++;
break;
case LinphoneChatRoomStateCreationFailed:
manager->stat.number_of_LinphoneChatRoomStateCreationFailed++;
break;
case LinphoneChatRoomStateTerminationPending:
manager->stat.number_of_LinphoneChatRoomStateTerminationPending++;
break;
case LinphoneChatRoomStateTerminated:
manager->stat.number_of_LinphoneChatRoomStateTerminated++;
break;
case LinphoneChatRoomStateCreationFailed:
manager->stat.number_of_LinphoneChatRoomStateCreationFailed++;
case LinphoneChatRoomStateTerminationFailed:
manager->stat.number_of_LinphoneChatRoomStateTerminationFailed++;
break;
case LinphoneChatRoomStateDeleted:
manager->stat.number_of_LinphoneChatRoomStateDeleted++;
......@@ -2084,6 +2087,8 @@ static void group_chat_room_unique_one_to_one_chat_room (void) {
// Marie deletes the chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
wait_for_list(coresList, 0, 1, 2000);
BC_ASSERT_EQUAL(pauline->stat.number_of_participants_removed, initialPaulineStats.number_of_participants_removed, int, "%d");
// Marie creates the chat room again
initialMarieStats = marie->stat;
......@@ -2146,6 +2151,8 @@ static void group_chat_room_unique_one_to_one_chat_room_recreated_from_message (
// Marie deletes the chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
wait_for_list(coresList, 0, 1, 2000);
BC_ASSERT_EQUAL(pauline->stat.number_of_participants_removed, initialPaulineStats.number_of_participants_removed, int, "%d");
// Pauline sends a new message
initialMarieStats = marie->stat;
......
......@@ -186,9 +186,10 @@ typedef struct _stats {
int number_of_LinphoneChatRoomStateInstantiated;
int number_of_LinphoneChatRoomStateCreationPending;
int number_of_LinphoneChatRoomStateCreated;
int number_of_LinphoneChatRoomStateCreationFailed;
int number_of_LinphoneChatRoomStateTerminationPending;
int number_of_LinphoneChatRoomStateTerminated;
int number_of_LinphoneChatRoomStateCreationFailed;
int number_of_LinphoneChatRoomStateTerminationFailed;
int number_of_LinphoneChatRoomStateDeleted;
int number_of_IframeDecoded;
......
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