mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 05:38:14 +00:00
notify fallbacked chat room creation
This commit is contained in:
parent
554ad75cca
commit
fe8930cecd
5 changed files with 23 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ class EventLog;
|
|||
class LINPHONE_PUBLIC AbstractChatRoom : public Object, public CoreAccessor, public ConferenceInterface {
|
||||
friend class ChatMessage;
|
||||
friend class ChatMessagePrivate;
|
||||
friend class ClientGroupToBasicChatRoomPrivate;
|
||||
friend class CorePrivate;
|
||||
friend class MainDb;
|
||||
friend class ProxyChatRoomPrivate;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
class BasicChatRoomPrivate;
|
||||
|
||||
class LINPHONE_PUBLIC BasicChatRoom : public ChatRoom {
|
||||
friend class Core;
|
||||
friend class CorePrivate;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -68,7 +68,12 @@ public:
|
|||
cgcr->getPrivate()->setChatRoomListener(nullptr);
|
||||
Core::deleteChatRoom(q->getSharedFromThis());
|
||||
LinphoneChatRoom *lcr = L_GET_C_BACK_PTR(q);
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(lcr, cgcr->getCore()->getOrCreateBasicChatRoom(invitedAddresses.front()));
|
||||
shared_ptr<AbstractChatRoom> bcr = cgcr->getCore()->onlyGetOrCreateBasicChatRoom(invitedAddresses.front());
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(lcr, bcr);
|
||||
bcr->getPrivate()->setState(ChatRoom::State::Instantiated);
|
||||
bcr->getPrivate()->setState(ChatRoom::State::Created);
|
||||
cgcr->getCore()->getPrivate()->insertChatRoom(bcr);
|
||||
cgcr->getCore()->getPrivate()->insertChatRoomWithDb(bcr);
|
||||
return;
|
||||
}
|
||||
cgcr->getPrivate()->onCallSessionStateChanged(session, newState, message);
|
||||
|
|
|
|||
|
|
@ -185,6 +185,20 @@ shared_ptr<AbstractChatRoom> Core::createClientGroupChatRoom (const string &subj
|
|||
return d->createClientGroupChatRoom(subject, true);
|
||||
}
|
||||
|
||||
shared_ptr<AbstractChatRoom> Core::onlyGetOrCreateBasicChatRoom (const IdentityAddress &peerAddress, bool isRtt) {
|
||||
list<shared_ptr<AbstractChatRoom>> chatRooms = findChatRooms(peerAddress);
|
||||
if (!chatRooms.empty())
|
||||
return chatRooms.front();
|
||||
|
||||
const ChatRoomId &chatRoomId = ChatRoomId(peerAddress, getDefaultLocalAddress(getSharedFromThis(), peerAddress));
|
||||
shared_ptr<AbstractChatRoom> chatRoom;
|
||||
|
||||
BasicChatRoom *basicChatRoom = new BasicChatRoom(getSharedFromThis(), chatRoomId);
|
||||
chatRoom.reset(basicChatRoom);
|
||||
|
||||
return chatRoom;
|
||||
}
|
||||
|
||||
shared_ptr<AbstractChatRoom> Core::getOrCreateBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt) {
|
||||
L_D();
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ public:
|
|||
const IdentityAddress &localAddress
|
||||
);
|
||||
|
||||
std::shared_ptr<AbstractChatRoom> onlyGetOrCreateBasicChatRoom (const IdentityAddress &peerAddress, bool isRtt = false);
|
||||
std::shared_ptr<AbstractChatRoom> getOrCreateBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt = false);
|
||||
std::shared_ptr<AbstractChatRoom> getOrCreateBasicChatRoom (const IdentityAddress &peerAddress, bool isRtt = false);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue