diff --git a/src/Cache.cpp b/src/Cache.cpp
index 5edfaf09..ea034dd0 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -3584,8 +3584,6 @@ Cache::roomMembers(const std::string &room_id)
crypto::Trust
Cache::roomVerificationStatus(const std::string &room_id)
{
- std::string_view keys;
-
crypto::Trust trust = crypto::Verified;
try {
diff --git a/src/MemberList.cpp b/src/MemberList.cpp
index 196647fe..0c0f0cdd 100644
--- a/src/MemberList.cpp
+++ b/src/MemberList.cpp
@@ -53,6 +53,7 @@ MemberList::roleNames() const
{Mxid, "mxid"},
{DisplayName, "displayName"},
{AvatarUrl, "avatarUrl"},
+ {Trustlevel, "trustlevel"},
};
}
@@ -69,6 +70,17 @@ MemberList::data(const QModelIndex &index, int role) const
return m_memberList[index.row()].first.display_name;
case AvatarUrl:
return m_memberList[index.row()].second;
+ case Trustlevel: {
+ auto stat =
+ cache::verificationStatus(m_memberList[index.row()].first.user_id.toStdString());
+
+ if (!stat)
+ return crypto::Unverified;
+ if (stat->unverified_device_count)
+ return crypto::Unverified;
+ else
+ return stat->user_verified;
+ }
default:
return {};
}
diff --git a/src/MemberList.h b/src/MemberList.h
index e6522694..cffcd83d 100644
--- a/src/MemberList.h
+++ b/src/MemberList.h
@@ -25,6 +25,7 @@ public:
Mxid,
DisplayName,
AvatarUrl,
+ Trustlevel,
};
MemberList(const QString &room_id, QObject *parent = nullptr);
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index b23ed278..906e328f 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -375,10 +375,12 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
}
void
-TimelineViewManager::openRoomMembers(QString room_id)
+TimelineViewManager::openRoomMembers(TimelineModel *room)
{
- MemberList *memberList = new MemberList(room_id, this);
- emit openRoomMembersDialog(memberList);
+ if (!room)
+ return;
+ MemberList *memberList = new MemberList(room->roomId(), this);
+ emit openRoomMembersDialog(memberList, room);
}
void
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 54e3a935..4dd5e996 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -66,7 +66,7 @@ public:
Q_INVOKABLE QString userPresence(QString id) const;
Q_INVOKABLE QString userStatus(QString id) const;
- Q_INVOKABLE void openRoomMembers(QString room_id);
+ Q_INVOKABLE void openRoomMembers(TimelineModel *room);
Q_INVOKABLE void openRoomSettings(QString room_id);
Q_INVOKABLE void openInviteUsers(QString roomId);
Q_INVOKABLE void openGlobalUserProfile(QString userId);
@@ -92,7 +92,7 @@ signals:
void focusChanged();
void focusInput();
void openImageOverlayInternalCb(QString eventId, QImage img);
- void openRoomMembersDialog(MemberList *members);
+ void openRoomMembersDialog(MemberList *members, TimelineModel *room);
void openRoomSettingsDialog(RoomSettings *settings);
void openInviteUsersDialog(InviteesModel *invitees);
void openProfile(UserProfile *profile);
|