diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-07-20 02:34:07 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-07-20 02:34:07 +0200 |
commit | 185c485fc68df7c76803e29a1d77819fc49f6812 (patch) | |
tree | 1f47a0ce815efab3107e3f00c28827ec651e49d3 /src/eu/siacs/conversations/entities/Conversation.java | |
parent | 22e504b8f96af6c5f54d8f7c82a190fefa4e5fb1 (diff) |
fixed #254
Diffstat (limited to 'src/eu/siacs/conversations/entities/Conversation.java')
-rw-r--r-- | src/eu/siacs/conversations/entities/Conversation.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java index 4e8c1834..e04d7bf8 100644 --- a/src/eu/siacs/conversations/entities/Conversation.java +++ b/src/eu/siacs/conversations/entities/Conversation.java @@ -114,7 +114,7 @@ public class Conversation extends AbstractEntity { this.messages.get(i).markRead(); } } - + public String popLatestMarkableMessageId() { String id = this.latestMarkableMessageId; this.latestMarkableMessageId = null; @@ -141,7 +141,8 @@ public class Conversation extends AbstractEntity { if ((getMode() == MODE_MULTI) && (getMucOptions().getSubject() != null) && useSubject) { return getMucOptions().getSubject(); - } else if (getMode() == MODE_MULTI && bookmark!=null && bookmark.getName() != null) { + } else if (getMode() == MODE_MULTI && bookmark != null + && bookmark.getName() != null) { return bookmark.getName(); } else { return this.getContact().getDisplayName(); @@ -238,7 +239,7 @@ public class Conversation extends AbstractEntity { this.otrSessionNeedsStarting = false; return this.otrSession; } else { - this.otrSessionNeedsStarting = true; + this.otrSessionNeedsStarting = true; } return this.otrSession; } catch (OtrException e) { @@ -267,7 +268,7 @@ public class Conversation extends AbstractEntity { } } } - + public void endOtrIfNeeded() { if (this.otrSession != null) { if (this.otrSession.getSessionStatus() == SessionStatus.ENCRYPTED) { @@ -372,7 +373,7 @@ public class Conversation extends AbstractEntity { public void setSymmetricKey(byte[] key) { this.symmetricKey = key; } - + public byte[] getSymmetricKey() { return this.symmetricKey; } @@ -381,7 +382,7 @@ public class Conversation extends AbstractEntity { this.bookmark = bookmark; this.bookmark.setConversation(this); } - + public void deregisterWithBookmark() { if (this.bookmark != null) { this.bookmark.setConversation(null); @@ -391,4 +392,13 @@ public class Conversation extends AbstractEntity { public Bookmark getBookmark() { return this.bookmark; } + + public void failWaitingOtrMessages() { + for (Message message : this.messages) { + if (message.getEncryption() == Message.ENCRYPTION_OTR + && message.getStatus() == Message.STATUS_WAITING) { + message.setStatus(Message.STATUS_SEND_FAILED); + } + } + } } |