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

Add TerminationFailed state to ChatRoom.

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