Add an option to disable encryption in new chats
Right now NeoChat (or more technically, libQuotient) decides to use encryption by default in new chats. Some users may not prefer or need this, so a new option is added under Security to change this behavior. BUG: 498375
This commit is contained in:
@@ -223,6 +223,10 @@
|
||||
<label>Reject unknown invites</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="PreferUsingEncryption" type="bool">
|
||||
<label>Prefer encrypting chats</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
||||
|
||||
@@ -145,6 +145,10 @@ void NeoChatConnection::connectSignals()
|
||||
});
|
||||
},
|
||||
Qt::SingleShotConnection);
|
||||
setDirectChatEncryptionDefault(NeoChatConfig::preferUsingEncryption());
|
||||
connect(NeoChatConfig::self(), &NeoChatConfig::PreferUsingEncryptionChanged, this, [] {
|
||||
setDirectChatEncryptionDefault(NeoChatConfig::preferUsingEncryption());
|
||||
});
|
||||
}
|
||||
|
||||
int NeoChatConnection::badgeNotificationCount() const
|
||||
|
||||
@@ -65,6 +65,21 @@ FormCard.FormCardPage {
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: rejectInvitationsDelegate
|
||||
below: preferEncryptionDelegate
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
id: preferEncryptionDelegate
|
||||
text: i18nc("@option:check", "Turn on encryption in new chats")
|
||||
description: i18nc("@info", "If enabled, NeoChat will use encryption when starting new direct messages.")
|
||||
checked: NeoChatConfig.preferUsingEncryption
|
||||
enabled: !NeoChatConfig.preferUsingEncryptionImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.preferUsingEncryption = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title:group", "Encryption")
|
||||
|
||||
Reference in New Issue
Block a user