Fix NeoChatRoom::directChatRemoteMember

- Don't access member that's not there
- Use NeoChatRoomMember instead of RoomMember

BUG: 492733
This commit is contained in:
Tobias Fella
2024-09-19 16:00:20 +02:00
parent 977ea73237
commit 2a5359e73b
2 changed files with 9 additions and 4 deletions

View File

@@ -1731,9 +1731,13 @@ int NeoChatRoom::maxRoomVersion() const
return maxVersion;
}
Quotient::RoomMember NeoChatRoom::directChatRemoteMember() const
NeochatRoomMember *NeoChatRoom::directChatRemoteMember()
{
return directChatMembers()[0];
if (directChatMembers().size() == 0) {
qWarning() << "No other member available in this room";
return {};
}
return new NeochatRoomMember(this, directChatMembers()[0].id());
}
void NeoChatRoom::sendLocation(float lat, float lon, const QString &description)