Do not show messages as unread when the conversation is open

* Only show them as unread when they arrive out of order
* Mark all messages as read when sending a message
This commit is contained in:
Torsten Grote
2016-01-13 19:01:41 -02:00
parent 36a850d83e
commit 9aa1bbd1ed
4 changed files with 70 additions and 15 deletions

View File

@@ -223,8 +223,7 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
lock.writeLock().unlock();
}
if (!duplicate && subscribed) {
GroupId g = m.getGroup().getId();
eventBus.broadcast(new MessageAddedEvent(g, null));
eventBus.broadcast(new MessageAddedEvent(m, null));
}
}
@@ -1053,8 +1052,7 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
}
if (visible) {
if (!duplicate) {
GroupId g = m.getGroup().getId();
eventBus.broadcast(new MessageAddedEvent(g, c));
eventBus.broadcast(new MessageAddedEvent(m, c));
}
eventBus.broadcast(new MessageToAckEvent(c));
}