diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-23 19:44:58 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-23 19:44:58 +0200 |
commit | 91a3cee6d2ddcb647082b517d2781c00fb1f844d (patch) | |
tree | 598bd481c95f99119a5bae4b189e4e6ed32863d5 /src/main/java/eu/siacs/conversations/entities/Conversation.java | |
parent | 412efe93c0988e3a130bac35802fca139787d68a (diff) | |
parent | 8043833156119eef4662c50f30ca647bfc6d4438 (diff) |
Merge branch 'master' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Conversation.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Conversation.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 9f9f34cf..36d6b43b 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -552,7 +552,7 @@ public class Conversation extends AbstractEntity implements Blockable { private int getMostRecentlyUsedOutgoingEncryption() { synchronized (this.messages) { for(int i = this.messages.size() -1; i >= 0; --i) { - final Message m = this.messages.get(0); + final Message m = this.messages.get(i); if (!m.isCarbon() && m.getStatus() != Message.STATUS_RECEIVED) { final int e = m.getEncryption(); if (e == Message.ENCRYPTION_DECRYPTED || e == Message.ENCRYPTION_DECRYPTION_FAILED) { @@ -569,7 +569,7 @@ public class Conversation extends AbstractEntity implements Blockable { private int getMostRecentlyUsedIncomingEncryption() { synchronized (this.messages) { for(int i = this.messages.size() -1; i >= 0; --i) { - final Message m = this.messages.get(0); + final Message m = this.messages.get(i); if (m.getStatus() == Message.STATUS_RECEIVED) { final int e = m.getEncryption(); if (e == Message.ENCRYPTION_DECRYPTED || e == Message.ENCRYPTION_DECRYPTION_FAILED) { |