diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-15 22:48:45 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-15 22:48:45 +0100 |
commit | fae03f7b0b4c9491fb7ce57e94ab8148fb580b0d (patch) | |
tree | dcb4b614db26cfbe8a8a4642123b4cbb0ee9edfe /src/main/java/de | |
parent | 1185eb6aa97fb30639fae4a83ce3f0e7e33de428 (diff) |
Stop automagically select default encryption
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 9b58892f8..0d9ccd30f 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -23,7 +23,6 @@ import java.util.List; import de.pixart.messenger.Config; import de.pixart.messenger.crypto.PgpDecryptionService; -import de.pixart.messenger.crypto.axolotl.AxolotlService; import de.pixart.messenger.xmpp.chatstate.ChatState; import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; @@ -710,37 +709,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } public int getNextEncryption() { - final AxolotlService axolotlService = getAccount().getAxolotlService(); - int next = this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, -1); - if (next == -1) { - if (Config.supportOmemo() - && axolotlService != null - && mode == MODE_SINGLE - && axolotlService.isConversationAxolotlCapable(this) - && getAccount().getSelfContact().getPresences().allOrNonSupport(AxolotlService.PEP_DEVICE_LIST_NOTIFY) - && getContact().getPresences().allOrNonSupport(AxolotlService.PEP_DEVICE_LIST_NOTIFY) - && Config.AlwayUseOMEMO){ - return Message.ENCRYPTION_AXOLOTL; - } else { - next = this.getMostRecentlyUsedIncomingEncryption(); - } - } - - if (!Config.supportUnencrypted() && next <= 0) { - if (Config.supportOmemo() - && ((axolotlService != null && axolotlService.isConversationAxolotlCapable(this)) || !Config.multipleEncryptionChoices())) { - return Message.ENCRYPTION_AXOLOTL; - } else if (Config.supportOtr() && mode == MODE_SINGLE) { - return Message.ENCRYPTION_OTR; - } else if (Config.supportOpenPgp() - && (mode == MODE_SINGLE) || !Config.multipleEncryptionChoices()) { - return Message.ENCRYPTION_PGP; - } - } else if (next == Message.ENCRYPTION_AXOLOTL - && (!Config.supportOmemo() || axolotlService == null || !axolotlService.isConversationAxolotlCapable(this))) { - next = Message.ENCRYPTION_NONE; - } - return next; + return this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, Message.ENCRYPTION_NONE); } public void setNextEncryption(int encryption) { |