Show verification status in memberlist

This commit is contained in:
Nicolas Werner 2021-08-13 23:58:26 +02:00
parent 18ea01e198
commit 9bad584931
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
8 changed files with 59 additions and 16 deletions

View file

@ -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 {};
}