From d94a764999ae184dbbf48ba226f83cf7077bcd43 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 27 Oct 2017 14:58:22 +0200 Subject: [PATCH] feat(Core): add tmp workaround on findChatRoom --- src/core/core-chat-room.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/core-chat-room.cpp b/src/core/core-chat-room.cpp index ac50b37fa..84ae4d63a 100644 --- a/src/core/core-chat-room.cpp +++ b/src/core/core-chat-room.cpp @@ -105,7 +105,18 @@ const list> &Core::getChatRooms () const { shared_ptr Core::findChatRoom (const Address &peerAddress) const { L_D(); - auto it = d->chatRoomsByUri.find(getCleanedPeerAddress(peerAddress).asStringUriOnly()); + + Address cleanedAddress = getCleanedPeerAddress(peerAddress); + auto it = d->chatRoomsByUri.find(cleanedAddress.asStringUriOnly()); + if (it != d->chatRoomsByUri.cend()) + return it->second; + + // TODO: Remove me, temp workaround. + cleanedAddress.setDomain(Address(linphone_core_get_conference_factory_uri(d->cCore)).getDomain()); + lWarning() << "We don't found the chat room with address " << peerAddress.asString() << + " as a temporary workaround, searching with " << cleanedAddress.asString(); + + it = d->chatRoomsByUri.find(cleanedAddress.asStringUriOnly()); return it == d->chatRoomsByUri.cend() ? shared_ptr() : it->second; }