Mark messages read properly in private conversation.

This commit is contained in:
akwizgran
2016-11-04 16:07:11 +00:00
parent 51bcf7b1b8
commit 238100bcac
4 changed files with 42 additions and 47 deletions

View File

@@ -153,8 +153,9 @@ public abstract class BdfIncomingMessageHook implements IncomingMessageHook,
// update unread counter in group metadata
GroupCount c = getGroupCount(txn, g);
BdfDictionary d = new BdfDictionary();
d.put(GROUP_KEY_UNREAD_COUNT,
c.getUnreadCount() + (read ? -1 : 1));
int count = c.getUnreadCount() + (read ? -1 : 1);
if (count < 0) throw new DbException();
d.put(GROUP_KEY_UNREAD_COUNT, count);
clientHelper.mergeGroupMetadata(txn, g, d);
}
db.commitTransaction(txn);