Commit 4170acf9 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Terminate client group chat rooms only when the call session reaches the released state.

parent 49cbc7ce
...@@ -62,6 +62,7 @@ static void call_received(SalCallOp *h) { ...@@ -62,6 +62,7 @@ static void call_received(SalCallOp *h) {
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
h->decline(SalReasonServiceUnavailable, nullptr); h->decline(SalReasonServiceUnavailable, nullptr);
h->release();
return; return;
} }
...@@ -101,6 +102,7 @@ static void call_received(SalCallOp *h) { ...@@ -101,6 +102,7 @@ static void call_received(SalCallOp *h) {
list<IdentityAddress> identAddresses = ServerGroupChatRoom::parseResourceLists(h->get_remote_body()); list<IdentityAddress> identAddresses = ServerGroupChatRoom::parseResourceLists(h->get_remote_body());
if (identAddresses.size() != 1) { if (identAddresses.size() != 1) {
h->decline(SalReasonNotAcceptable, nullptr); h->decline(SalReasonNotAcceptable, nullptr);
h->release();
return; return;
} }
IdentityAddress confAddr = L_GET_PRIVATE_FROM_C_OBJECT(lc)->mainDb->findOneToOneConferenceChatRoomAddress(from, identAddresses.front()); IdentityAddress confAddr = L_GET_PRIVATE_FROM_C_OBJECT(lc)->mainDb->findOneToOneConferenceChatRoomAddress(from, identAddresses.front());
...@@ -126,6 +128,7 @@ static void call_received(SalCallOp *h) { ...@@ -126,6 +128,7 @@ static void call_received(SalCallOp *h) {
} else { } else {
//invite is for an unknown chatroom //invite is for an unknown chatroom
h->decline(SalReasonNotFound, nullptr); h->decline(SalReasonNotFound, nullptr);
h->release();
} }
} else { } else {
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
......
...@@ -170,7 +170,7 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged ( ...@@ -170,7 +170,7 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged (
} else if (q->getState() == ChatRoom::State::TerminationPending) } else if (q->getState() == ChatRoom::State::TerminationPending)
qConference->getPrivate()->focus->getPrivate()->getSession()->terminate(); qConference->getPrivate()->focus->getPrivate()->getSession()->terminate();
} else if (newState == CallSession::State::End) { } else if (newState == CallSession::State::End) {
q->onConferenceTerminated(q->getConferenceAddress()); setState(ChatRoom::State::TerminationPending);
} else if (newState == CallSession::State::Released) { } else if (newState == CallSession::State::Released) {
if (q->getState() == ChatRoom::State::TerminationPending) { if (q->getState() == ChatRoom::State::TerminationPending) {
if (session->getReason() == LinphoneReasonNone) { if (session->getReason() == LinphoneReasonNone) {
...@@ -548,6 +548,11 @@ void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) { ...@@ -548,6 +548,11 @@ void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) {
void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) { void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {
L_D(); L_D();
if (getState() != ChatRoom::State::Created) {
lWarning() << "First notify received in ClientGroupChatRoom that is not in the Created state, ignoring it!";
return;
}
bool performMigration = false; bool performMigration = false;
shared_ptr<AbstractChatRoom> chatRoom; shared_ptr<AbstractChatRoom> chatRoom;
if (getParticipantCount() == 1) { if (getParticipantCount() == 1) {
......
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