aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-10-21 17:41:44 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-10-21 17:41:44 +0200
commit3c45f00443e56557183f94d1152a0847342db510 (patch)
tree0ab275b8289802e6ca42b001c5033022c0924852 /src/main/java/eu
parentd56214f096a27c044a96f9fe87f4f35f48a98470 (diff)
fixed read conversations showing up as notifications after a restart
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index f2c4fed4..5f3f1a6e 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -313,12 +313,11 @@ public class Conversation extends AbstractEntity implements Blockable {
public List<Message> markRead() {
final List<Message> unread = new ArrayList<>();
synchronized (this.messages) {
- for (int i = this.messages.size() - 1; i >= 0; --i) {
- if (this.messages.get(i).isRead()) {
- break;
+ for(Message message : this.messages) {
+ if (!message.isRead()) {
+ message.markRead();
+ unread.add(message);
}
- this.messages.get(i).markRead();
- unread.add(this.messages.get(i));
}
}
return unread;