diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-05-07 12:33:55 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-05-07 12:33:55 +0200 |
commit | 955b7dbc7e56e2bf631a5ccf10ad306938511af4 (patch) | |
tree | c3762be120e65f33f361d6857f3fc7a6bb86aabe /src/eu/siacs/conversations/entities/Conversation.java | |
parent | 6b20a213b06d848fef583bee855e4bfb8e430837 (diff) |
wee bit of code cleanup
Diffstat (limited to 'src/eu/siacs/conversations/entities/Conversation.java')
-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 0f4d24e5..c02ae9e7 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; + } } |