aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/Config.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-02-24 14:47:49 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-02-24 14:47:49 +0100
commitd1a456f3e3e3f82e8e7b7f36d12b62ebb2a0fac2 (patch)
tree33b0f8dac6ea563938a1f557ec4dab542488090b /src/main/java/eu/siacs/conversations/Config.java
parentddafa65849e6c7e8d17566208b57ec614de05d5f (diff)
made hard coded choice for encryptions more flexible and disable parsing
Diffstat (limited to 'src/main/java/eu/siacs/conversations/Config.java')
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index 4d64c3aa..549778f3 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -6,13 +6,43 @@ import eu.siacs.conversations.xmpp.chatstate.ChatState;
public final class Config {
+
+ private static final int UNENCRYPTED = 1;
+ private static final int OPENPGP = 2;
+ private static final int OTR = 4;
+ private static final int OMEMO = 8;
+
+ private static final int ENCRYPTION_MASK = UNENCRYPTED | OPENPGP | OTR | OMEMO;
+
+ public static boolean supportUnencrypted() {
+ return (ENCRYPTION_MASK & UNENCRYPTED) != 0;
+ }
+
+ public static boolean supportOpenPgp() {
+ return (ENCRYPTION_MASK & OPENPGP) != 0;
+ }
+
+ public static boolean supportOpenPgpOnly() {
+ return supportOpenPgp() && !multipleEncryptionChoices();
+ }
+
+ public static boolean supportOtr() {
+ return (ENCRYPTION_MASK & OTR) != 0;
+ }
+
+ public static boolean supportOmemo() {
+ return (ENCRYPTION_MASK & OMEMO) != 0;
+ }
+
+ public static boolean multipleEncryptionChoices() {
+ return (ENCRYPTION_MASK & (ENCRYPTION_MASK - 1)) != 0;
+ }
+
public static final String LOGTAG = "conversations";
public static final String DOMAIN_LOCK = null; //only allow account creation for this domain
public static final boolean DISALLOW_REGISTRATION_IN_UI = false; //hide the register checkbox
- public static final boolean HIDE_PGP_IN_UI = false; //some more consumer focused clients might want to disable OpenPGP
- public static final boolean FORCE_E2E_ENCRYPTION = false; //disables ability to send unencrypted 1-on-1
public static final boolean ALLOW_NON_TLS_CONNECTIONS = false; //very dangerous. you should have a good reason to set this to true
public static final boolean FORCE_ORBOT = false; // always use TOR
public static final boolean HIDE_MESSAGE_TEXT_IN_NOTIFICATION = false;