diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-01 22:41:58 +0100 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2015-12-04 20:12:48 +0100 |
commit | e9c184fbce5e3bfaa25a0ecca6d1942014e4d977 (patch) | |
tree | e5d07bc512a6b86877cd276f10ffedefac31de48 /src/main/java/eu/siacs/conversations/entities | |
parent | 0b6f5f29197fad79bb90be4d51c1b87c7577e4ff (diff) |
introduced build-time paranoia mode that disables unencrypted chats a…
…nd forces TOR
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Conversation.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index ee1eb2110..271ddd621 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -626,9 +626,16 @@ public class Conversation extends AbstractEntity implements Blockable { if (next == -1) { int outgoing = this.getMostRecentlyUsedOutgoingEncryption(); if (outgoing == Message.ENCRYPTION_NONE) { - return this.getMostRecentlyUsedIncomingEncryption(); + next = this.getMostRecentlyUsedIncomingEncryption(); } else { - return outgoing; + next = outgoing; + } + } + if (Config.PARANOID_MODE && mode == MODE_SINGLE && next <= 0) { + if (getAccount().getAxolotlService().isContactAxolotlCapable(getContact())) { + return Message.ENCRYPTION_AXOLOTL; + } else { + return Message.ENCRYPTION_OTR; } } return next; |