Implement device verification

This commit is contained in:
Tobias Fella
2022-04-03 23:54:28 +02:00
parent 3071901a47
commit b8262fef92
19 changed files with 403 additions and 7 deletions

View File

@@ -55,6 +55,7 @@ QHash<int, QByteArray> MessageEventModel::roleNames() const
roles[FormattedBodyRole] = "formattedBody";
roles[AuthorIdRole] = "authorId";
roles[MediaUrlRole] = "mediaUrl";
roles[VerifiedRole] = "verified";
return roles;
}
@@ -791,6 +792,17 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
return m_currentRoom->urlToDownload(evt.id());
}
if (role == VerifiedRole) {
#ifdef QUOTIENT_07
if (evt.originalEvent()) {
auto encrypted = dynamic_cast<const EncryptedEvent *>(evt.originalEvent());
Q_ASSERT(encrypted);
return m_currentRoom->connection()->isVerifiedSession(encrypted->sessionId());
}
return false;
#endif
}
return {};
}