Don't treat a space as a direct chat

This commit is contained in:
Loren Burkholder 2022-04-02 19:07:20 -04:00
parent 4e5e5d55eb
commit 3bb00aa96c

View file

@ -1241,7 +1241,8 @@ ChatPage::startChat(QString userid, std::optional<bool> encryptionEnabled)
auto room_infos = cache::getRoomInfo(joined_rooms); auto room_infos = cache::getRoomInfo(joined_rooms);
for (const std::string &room_id : 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); auto room_members = cache::roomMembers(room_id);
if (std::find(room_members.begin(), room_members.end(), (userid).toStdString()) != if (std::find(room_members.begin(), room_members.end(), (userid).toStdString()) !=
room_members.end()) { room_members.end()) {