diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/Config.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/Config.java | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index f7ed9f96d..54fe7e45a 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -6,17 +6,49 @@ import eu.siacs.conversations.xmpp.chatstate.ChatState; public final class Config { - public static final String LOGTAG = "conversations"; + 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 = "pix-art.de"; //only allow account creation for this domain - public static final boolean DISALLOW_REGISTRATION_IN_UI = false; //hide the register checkbox + public static final String CONFERENCE_DOMAIN_LOCK = null; //only allow conference creation for this domain + public static final boolean LOCK_DOMAINS_IN_CONVERSATIONS = false; //only add contacts and conferences for own domains - public static final boolean HIDE_PGP_IN_UI = false; //some more consumer focused clients might want to disable OpenPGP - public static final boolean HIDE_ENCRYPTION_IN_UI = false; //completely hide encryption options in menu bar + public static final boolean SINGLE_ACCOUNT = true; //set to true to allow only one account + public static final boolean DISALLOW_REGISTRATION_IN_UI = false; //hide the register checkbox - 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_E2E_ENCRYPTION = false; //disables ability to send unencrypted 1-on-1 public static final boolean FORCE_ORBOT = false; // always use TOR public static final boolean HIDE_MESSAGE_TEXT_IN_NOTIFICATION = false; |