Add button to encrypt room
This commit is contained in:
@@ -67,6 +67,7 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
||||
connect(this, &Room::displaynameChanged, this, &NeoChatRoom::displayNameChanged);
|
||||
|
||||
connectSingleShot(this, &Room::baseStateLoaded, this, [this]() {
|
||||
Q_EMIT canEncryptRoomChanged();
|
||||
if (this->joinState() != JoinState::Invite) {
|
||||
return;
|
||||
}
|
||||
@@ -80,6 +81,9 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
||||
}
|
||||
NotificationsManager::instance().postInviteNotification(this, htmlSafeDisplayName(), htmlSafeMemberName(senderId), avatar_image);
|
||||
});
|
||||
connect(this, &Room::changed, this, [this] {
|
||||
Q_EMIT canEncryptRoomChanged();
|
||||
});
|
||||
}
|
||||
|
||||
void NeoChatRoom::uploadFile(const QUrl &url, const QString &body)
|
||||
@@ -1165,3 +1169,13 @@ void NeoChatRoom::setSavedText(const QString &savedText)
|
||||
{
|
||||
m_savedText = savedText;
|
||||
}
|
||||
|
||||
bool NeoChatRoom::canEncryptRoom() const
|
||||
{
|
||||
#ifdef QUOTIENT_07
|
||||
#ifdef Quotient_E2EE_ENABLED
|
||||
return !usesEncryption() && canSendState("m.room.encryption");
|
||||
#endif
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user