1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Add getter/setter for unread notif counts.

This commit is contained in:
David Baker
2016-01-20 17:16:20 +00:00
parent b3c06dd723
commit 8cb180525e
2 changed files with 29 additions and 0 deletions

View File

@@ -470,6 +470,14 @@ SyncApi.prototype._sync = function(syncOptions, attempt) {
// we do this first so it's correct when any of the events fire
room.unread_notifications = joinObj.unread_notifications || {};
if (joinObj.unread_notifications) {
room.setUnreadNotificationCount(
'total', joinObj.unread_notifications['notification_count']
);
room.setUnreadNotificationCount(
'highlight', joinObj.unread_notifications['highlight_count']
);
}
joinObj.timeline = joinObj.timeline || {};