mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-12-01 14:58:47 +03:00
Remove 'respond to key requests' functionality
This commit is contained in:
parent
b158c02e3b
commit
19f2c02eda
6 changed files with 2 additions and 50 deletions
|
@ -222,23 +222,6 @@ ApplicationWindow {
|
||||||
buttons: Dialog.Ok | Dialog.Cancel
|
buttons: Dialog.Ok | Dialog.Cancel
|
||||||
}
|
}
|
||||||
|
|
||||||
MatrixText {
|
|
||||||
visible: roomSettings.isEncryptionEnabled
|
|
||||||
text: qsTr("Respond to key requests")
|
|
||||||
}
|
|
||||||
|
|
||||||
ToggleButton {
|
|
||||||
visible: roomSettings.isEncryptionEnabled
|
|
||||||
ToolTip.text: qsTr("Whether or not the client should respond automatically with the session keys
|
|
||||||
upon request. Use with caution, this is a temporary measure to test the
|
|
||||||
E2E implementation until device verification is completed.")
|
|
||||||
checked: roomSettings.respondsToKeyRequests
|
|
||||||
onClicked: {
|
|
||||||
roomSettings.changeKeyRequestsPreference(checked);
|
|
||||||
}
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
// for adding extra space between sections
|
// for adding extra space between sections
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
@ -882,13 +882,12 @@ handle_key_request_message(const mtx::events::DeviceEvent<mtx::events::msg::KeyR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifiedDevice && !shouldSeeKeys &&
|
if (!verifiedDevice && !shouldSeeKeys) {
|
||||||
!utils::respondsToKeyRequests(req.content.room_id)) {
|
|
||||||
nhlog::crypto()->debug("ignoring key request for room {}", req.content.room_id);
|
nhlog::crypto()->debug("ignoring key request for room {}", req.content.room_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verifiedDevice || utils::respondsToKeyRequests(req.content.room_id)) {
|
if (verifiedDevice) {
|
||||||
// share the minimum index we have
|
// share the minimum index we have
|
||||||
minimumIndex = -1;
|
minimumIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,22 +172,6 @@ utils::scaleFactor()
|
||||||
return settings.value("settings/scale_factor", -1).toFloat();
|
return settings.value("settings/scale_factor", -1).toFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
utils::respondsToKeyRequests(const std::string &roomId)
|
|
||||||
{
|
|
||||||
return respondsToKeyRequests(QString::fromStdString(roomId));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
utils::respondsToKeyRequests(const QString &roomId)
|
|
||||||
{
|
|
||||||
if (roomId.isEmpty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
QSettings settings;
|
|
||||||
return settings.value("rooms/respond_to_key_requests/" + roomId, false).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
utils::setKeyRequestsPreference(QString roomId, bool value)
|
utils::setKeyRequestsPreference(QString roomId, bool value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,12 +67,6 @@ scaleFactor();
|
||||||
void
|
void
|
||||||
setScaleFactor(float factor);
|
setScaleFactor(float factor);
|
||||||
|
|
||||||
//! Whether or not we should respond to key requests for the given room.
|
|
||||||
bool
|
|
||||||
respondsToKeyRequests(const QString &roomId);
|
|
||||||
bool
|
|
||||||
respondsToKeyRequests(const std::string &roomId);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
setKeyRequestsPreference(QString roomId, bool value);
|
setKeyRequestsPreference(QString roomId, bool value);
|
||||||
|
|
||||||
|
|
|
@ -291,12 +291,6 @@ RoomSettings::accessJoinRules()
|
||||||
return accessRules_;
|
return accessRules_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
RoomSettings::respondsToKeyRequests()
|
|
||||||
{
|
|
||||||
return usesEncryption_ && utils::respondsToKeyRequests(roomid_);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RoomSettings::changeKeyRequestsPreference(bool isOn)
|
RoomSettings::changeKeyRequestsPreference(bool isOn)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,7 +78,6 @@ class RoomSettings : public QObject
|
||||||
Q_PROPERTY(bool canChangeJoinRules READ canChangeJoinRules CONSTANT)
|
Q_PROPERTY(bool canChangeJoinRules READ canChangeJoinRules CONSTANT)
|
||||||
Q_PROPERTY(bool canChangeNameAndTopic READ canChangeNameAndTopic CONSTANT)
|
Q_PROPERTY(bool canChangeNameAndTopic READ canChangeNameAndTopic CONSTANT)
|
||||||
Q_PROPERTY(bool isEncryptionEnabled READ isEncryptionEnabled NOTIFY encryptionChanged)
|
Q_PROPERTY(bool isEncryptionEnabled READ isEncryptionEnabled NOTIFY encryptionChanged)
|
||||||
Q_PROPERTY(bool respondsToKeyRequests READ respondsToKeyRequests NOTIFY keyRequestsChanged)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RoomSettings(QString roomid, QObject *parent = nullptr);
|
RoomSettings(QString roomid, QObject *parent = nullptr);
|
||||||
|
@ -91,7 +90,6 @@ public:
|
||||||
int memberCount() const;
|
int memberCount() const;
|
||||||
int notifications();
|
int notifications();
|
||||||
int accessJoinRules();
|
int accessJoinRules();
|
||||||
bool respondsToKeyRequests();
|
|
||||||
bool isLoading() const;
|
bool isLoading() const;
|
||||||
//! Whether the user has enough power level to send m.room.join_rules events.
|
//! Whether the user has enough power level to send m.room.join_rules events.
|
||||||
bool canChangeJoinRules() const;
|
bool canChangeJoinRules() const;
|
||||||
|
|
Loading…
Reference in a new issue