diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-08-24 11:21:02 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-08-24 11:21:02 +0200 |
commit | a30bc8a3e275890b9f39be56c1588aca34188dd4 (patch) | |
tree | 4da0e6e8466784696b24e276f58e390ba1267cb6 /src/eu | |
parent | e0b759340ded08ed7fcc3942473e7b3e3a91d2a1 (diff) |
use otr encrypiton instead of plain when contact has exactly one online presence and an otr fingerprint
Diffstat (limited to 'src/eu')
-rw-r--r-- | src/eu/siacs/conversations/entities/Conversation.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java index ce29301c9..439f9f22f 100644 --- a/src/eu/siacs/conversations/entities/Conversation.java +++ b/src/eu/siacs/conversations/entities/Conversation.java @@ -335,6 +335,16 @@ public class Conversation extends AbstractEntity { if ((latestEncryption == Message.ENCRYPTION_DECRYPTED) || (latestEncryption == Message.ENCRYPTION_DECRYPTION_FAILED)) { return Message.ENCRYPTION_PGP; + } else if (latestEncryption == Message.ENCRYPTION_NONE) { + if (getContact().getPresences().size() == 1) { + if (getContact().getOtrFingerprints().size() >= 1) { + return Message.ENCRYPTION_OTR; + } else { + return latestEncryption; + } + } else { + return latestEncryption; + } } else { return latestEncryption; } |