Merge pull request #1036 from Nheko-Reborn/fixCreateDirectChat

Don't treat a space as a direct chat
This commit is contained in:
DeepBlueV7.X 2022-04-03 01:17:42 +02:00 committed by GitHub
commit 747fe6408d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1248,7 +1248,8 @@ ChatPage::startChat(QString userid, std::optional<bool> encryptionEnabled)
auto room_infos = cache::getRoomInfo(joined_rooms);
for (const std::string &room_id : joined_rooms) {
if (room_infos[QString::fromStdString(room_id)].member_count == 2) {
if (const auto &info = room_infos[QString::fromStdString(room_id)];
info.member_count == 2 && !info.is_space) {
auto room_members = cache::roomMembers(room_id);
if (std::find(room_members.begin(), room_members.end(), (userid).toStdString()) !=
room_members.end()) {