fixed read conversations showing up as notifications after a restart
This commit is contained in:
parent
d56214f096
commit
3c45f00443
|
@ -313,12 +313,11 @@ public class Conversation extends AbstractEntity implements Blockable {
|
||||||
public List<Message> markRead() {
|
public List<Message> markRead() {
|
||||||
final List<Message> unread = new ArrayList<>();
|
final List<Message> unread = new ArrayList<>();
|
||||||
synchronized (this.messages) {
|
synchronized (this.messages) {
|
||||||
for (int i = this.messages.size() - 1; i >= 0; --i) {
|
for(Message message : this.messages) {
|
||||||
if (this.messages.get(i).isRead()) {
|
if (!message.isRead()) {
|
||||||
break;
|
message.markRead();
|
||||||
|
unread.add(message);
|
||||||
}
|
}
|
||||||
this.messages.get(i).markRead();
|
|
||||||
unread.add(this.messages.get(i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return unread;
|
return unread;
|
||||||
|
|
Loading…
Reference in a new issue