mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 15:18:11 +00:00
fix(Core): more robust deleteChatRoom impl
This commit is contained in:
parent
f337228785
commit
43947bee19
1 changed files with 22 additions and 2 deletions
|
|
@ -79,8 +79,28 @@ void CorePrivate::deleteChatRoom (const string &peerAddress) {
|
|||
auto it = find_if(chatRooms.begin(), chatRooms.end(), [&peerAddress](const shared_ptr<const ChatRoom> &chatRoom) {
|
||||
return peerAddress == chatRoom->getPeerAddress().asStringUriOnly();
|
||||
});
|
||||
if (it == chatRooms.end()) return;
|
||||
chatRooms.erase(it);
|
||||
if (it != chatRooms.end()) {
|
||||
chatRooms.erase(it);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Remove me, temp workaround.
|
||||
string workaroundAddress;
|
||||
{
|
||||
Address address(peerAddress);
|
||||
address.setDomain(Address(linphone_core_get_conference_factory_uri(cCore)).getDomain());
|
||||
workaroundAddress = address.asStringUriOnly();
|
||||
}
|
||||
|
||||
lWarning() << "We don't find the chat room with address " << peerAddress <<
|
||||
" as a temporary workaround, searching with " << workaroundAddress;
|
||||
it = find_if(chatRooms.begin(), chatRooms.end(), [&workaroundAddress](const shared_ptr<const ChatRoom> &chatRoom) {
|
||||
return workaroundAddress == chatRoom->getPeerAddress().asStringUriOnly();
|
||||
});
|
||||
if (it != chatRooms.end())
|
||||
chatRooms.erase(it);
|
||||
else
|
||||
lError() << "Unable to remove chat room: " << peerAddress;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue