summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-09-11 19:45:01 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-09-11 19:45:01 -0400
commitb9255803fb32aaf06700d47153bdc802881f1a66 (patch)
tree20b94a90724a9d6776a84cae5f363b94458bc678 /src/timeline
parentDon't try to check whether a preview is direct (diff)
downloadnheko-b9255803fb32aaf06700d47153bdc802881f1a66.tar.xz
Streamline getting other user id from invited direct chat
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/RoomlistModel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp
index c29e1adf..afe53560 100644
--- a/src/timeline/RoomlistModel.cpp
+++ b/src/timeline/RoomlistModel.cpp
@@ -165,9 +165,13 @@ RoomlistModel::data(const QModelIndex &index, int role) const
                         case Roles::Tags:
                                 return QStringList();
                         case Roles::IsDirect:
+                                // The list of users from the room doesn't contain the invited
+                                // users, so we won't factor the invite into the count
                                 return room.member_count == 1;
                         case Roles::DirectChatOtherUserId:
-                                return cache::getDirectInviteMember(roomid.toStdString()).user_id;
+                                return cache::getMembersFromInvite(roomid.toStdString(), 0, 1)
+                                  .front()
+                                  .user_id;
                         default:
                                 return {};
                         }