diff options
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r-- | src/eu/siacs/conversations/entities/Conversation.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java index 0f4d24e59..c02ae9e74 100644 --- a/src/eu/siacs/conversations/entities/Conversation.java +++ b/src/eu/siacs/conversations/entities/Conversation.java @@ -56,7 +56,7 @@ public class Conversation extends AbstractEntity { private transient String otrFingerprint = null; - public int nextMessageEncryption = Message.ENCRYPTION_NONE; + private int nextMessageEncryption = Message.ENCRYPTION_NONE; private transient MucOptions mucOptions = null; @@ -320,4 +320,21 @@ public class Conversation extends AbstractEntity { public String getNextPresence() { return this.nextPresence; } + + public int getLatestEncryption() { + int latestEncryption = this.getLatestMessage().getEncryption(); + if ((latestEncryption == Message.ENCRYPTION_DECRYPTED) || (latestEncryption == Message.ENCRYPTION_DECRYPTION_FAILED)) { + return Message.ENCRYPTION_PGP; + } else { + return latestEncryption; + } + } + + public int getNextEncryption() { + return this.nextMessageEncryption; + } + + public void setNextEncryption(int encryption) { + this.nextMessageEncryption = encryption; + } } |