mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 12:38:09 +00:00
Fixed ChatRoom state changed with Created state before RAM insertion breaking find
This commit is contained in:
parent
94c08dce7f
commit
53c83d3585
4 changed files with 6 additions and 2 deletions
|
|
@ -799,6 +799,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
|
|||
} else {
|
||||
LinphoneChatRoom *cr = _linphone_client_group_chat_room_new(lc, addr.asString().c_str(), nullptr);
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->join();
|
||||
L_GET_PRIVATE(lc->cppCore)->insertChatRoom(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
L_GET_PRIVATE_FROM_C_OBJECT(cr)->setState(LinphonePrivate::ChatRoom::State::Created);
|
||||
L_GET_PRIVATE(lc->cppCore)->insertChatRoomWithDb(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonNone);
|
||||
|
|
|
|||
|
|
@ -82,12 +82,14 @@ LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc,
|
|||
LinphoneChatRoom *_linphone_core_join_client_group_chat_room (LinphoneCore *lc, const LinphonePrivate::Address &addr) {
|
||||
LinphoneChatRoom *cr = _linphone_client_group_chat_room_new(lc, addr.asString().c_str(), nullptr);
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->join();
|
||||
L_GET_PRIVATE(lc->cppCore)->insertChatRoom(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
L_GET_PRIVATE(lc->cppCore)->insertChatRoomWithDb(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
return cr;
|
||||
}
|
||||
|
||||
LinphoneChatRoom *_linphone_core_create_server_group_chat_room (LinphoneCore *lc, LinphonePrivate::SalCallOp *op) {
|
||||
LinphoneChatRoom *cr = _linphone_server_group_chat_room_new(lc, op);
|
||||
L_GET_PRIVATE(lc->cppCore)->insertChatRoom(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
L_GET_PRIVATE(lc->cppCore)->insertChatRoomWithDb(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
return cr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ void ClientGroupChatRoom::onConferenceCreated (const Address &addr) {
|
|||
L_D_T(RemoteConference, dConference);
|
||||
dConference->conferenceAddress = addr;
|
||||
d->peerAddress = addr;
|
||||
d->core->cppCore->getPrivate()->insertChatRoom(getSharedFromThis());
|
||||
d->setState(ChatRoom::State::Created);
|
||||
d->core->cppCore->getPrivate()->insertChatRoomWithDb(getSharedFromThis());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ shared_ptr<ChatRoom> CorePrivate::createChatRoom (const Address &peerAddress, bo
|
|||
chatRoom = ObjectFactory::create<BasicChatRoom>(cCore, peerAddress);
|
||||
|
||||
ChatRoomPrivate *dChatRoom = chatRoom->getPrivate();
|
||||
insertChatRoom(chatRoom);
|
||||
dChatRoom->setState(ChatRoom::State::Instantiated);
|
||||
dChatRoom->setState(ChatRoom::State::Created);
|
||||
|
||||
|
|
@ -74,7 +75,6 @@ shared_ptr<ChatRoom> CorePrivate::createChatRoom (const Address &peerAddress, bo
|
|||
|
||||
void CorePrivate::insertChatRoom (const shared_ptr<ChatRoom> &chatRoom) {
|
||||
L_ASSERT(chatRoom);
|
||||
L_ASSERT(chatRoom->getState() == ChatRoom::State::Created);
|
||||
|
||||
Address cleanedPeerAddress = getCleanedPeerAddress(chatRoom->getPeerAddress());
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ void CorePrivate::deleteChatRoom (const string &peerAddress) {
|
|||
}
|
||||
|
||||
void CorePrivate::insertChatRoomWithDb (const shared_ptr<ChatRoom> &chatRoom) {
|
||||
insertChatRoom(chatRoom);
|
||||
L_ASSERT(chatRoom->getState() == ChatRoom::State::Created);
|
||||
|
||||
ChatRoom::CapabilitiesMask capabilities = chatRoom->getCapabilities();
|
||||
mainDb->insertChatRoom(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue