adapt findOneToOneChatroom to both basic and clientGroup

This commit is contained in:
Benjamin Reis 2017-12-22 16:37:42 +01:00
parent fe8930cecd
commit 47943bf874

View file

@ -172,8 +172,10 @@ shared_ptr<AbstractChatRoom> Core::findOneToOneChatRoom (
for (const auto &chatRoom : d->chatRooms) {
if (
chatRoom->getParticipantCount() == 1 &&
chatRoom->getLocalAddress() == localAddress &&
participantAddress == chatRoom->getParticipants().front()->getAddress()
(
(chatRoom->getLocalAddress() == localAddress && participantAddress == chatRoom->getParticipants().front()->getAddress()) ||
(chatRoom->getLocalAddress() == localAddress.getAddressWithoutGruu() && chatRoom->getPeerAddress() == participantAddress)
)
)
return chatRoom;
}