Fixed proxy chat room not being notified of Created state when we fallback to a basic chat room

This commit is contained in:
Sylvain Berfini 2018-04-06 15:15:37 +02:00
parent 0bf5362bf0
commit 8b5c4e0305

View file

@ -79,10 +79,15 @@ public:
cgcr->getPrivate()->setCallSessionListener(nullptr);
cgcr->getPrivate()->setChatRoomListener(nullptr);
Core::deleteChatRoom(q->getSharedFromThis());
setupProxy();
LinphoneChatRoom *lcr = L_GET_C_BACK_PTR(q);
shared_ptr<AbstractChatRoom> bcr = cgcr->getCore()->getOrCreateBasicChatRoom(invitedAddresses.front());
L_SET_CPP_PTR_FROM_C_OBJECT(lcr, bcr);
/* getOrCreateBasicChatRoom will automatically set the state to Instantiated and Created
* but because CPP ptr hasn't been set yet in this case the application's ChatRoom won't be notified
* that's why we set both states again here... */
bcr->getPrivate()->setState(ChatRoom::State::Instantiated);
bcr->getPrivate()->setState(ChatRoom::State::Created);
return;
}
cgcr->getPrivate()->onCallSessionStateChanged(session, newState, message);