aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/crypto/OmemoSetting.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2019-11-02 17:18:45 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2019-11-02 17:18:45 +0100
commit06949b76490736783520d783f0ec889e58707062 (patch)
tree946b6a6d16ba1d03ee2e82dbba79e2a6b8c128e3 /src/main/java/de/pixart/messenger/crypto/OmemoSetting.java
parentf81d60f9a84ebe491b9343f4dfbdf0e893100cd3 (diff)
introduce setting to completely disable (OMEMO) encryption
Diffstat (limited to 'src/main/java/de/pixart/messenger/crypto/OmemoSetting.java')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/OmemoSetting.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/OmemoSetting.java b/src/main/java/de/pixart/messenger/crypto/OmemoSetting.java
index 19fd6f9c0..973b44545 100644
--- a/src/main/java/de/pixart/messenger/crypto/OmemoSetting.java
+++ b/src/main/java/de/pixart/messenger/crypto/OmemoSetting.java
@@ -39,12 +39,17 @@ import de.pixart.messenger.ui.SettingsActivity;
public class OmemoSetting {
private static boolean always = false;
+ private static boolean never = false;
private static int encryption = Message.ENCRYPTION_AXOLOTL;
public static boolean isAlways() {
return always;
}
+ public static boolean isNever() {
+ return never;
+ }
+
public static int getEncryption() {
return encryption;
}
@@ -54,14 +59,22 @@ public class OmemoSetting {
switch (value) {
case "always":
always = true;
+ never = false;
encryption = Message.ENCRYPTION_AXOLOTL;
break;
case "default_on":
always = false;
+ never = false;
encryption = Message.ENCRYPTION_AXOLOTL;
break;
+ case "always_off":
+ always = false;
+ never = true;
+ encryption = Message.ENCRYPTION_NONE;
+ break;
default:
always = false;
+ never = false;
encryption = Message.ENCRYPTION_NONE;
break;