aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/Config.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-02-28 21:48:09 +0100
committersteckbrief <steckbrief@chefmail.de>2016-02-28 21:48:09 +0100
commitcd0c6ce48e2ac36d9524908acbbc79690b193d9a (patch)
treee03621214377147d44a13917485baf16b607a11a /src/main/java/eu/siacs/conversations/Config.java
parent8fb6204288d55f8af16ae47e32fa6c049284cadd (diff)
parentc393e6089177f31683c4cecfdb359802de1b5e0c (diff)
Merge tag '1.10.1' into trz/merge_1.10.1
Conflicts: README.md build.gradle src/main/java/eu/siacs/conversations/entities/ListItem.java src/main/java/eu/siacs/conversations/parser/MessageParser.java src/main/java/eu/siacs/conversations/services/XmppConnectionService.java src/main/java/eu/siacs/conversations/ui/ConversationFragment.java src/main/res/menu/message_context.xml src/main/res/xml/preferences.xml
Diffstat (limited to 'src/main/java/eu/siacs/conversations/Config.java')
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index a1da283f..0066074e 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -6,13 +6,48 @@ 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 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 SINGLE_ACCOUNT = false; //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 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;