diff --git a/src/matrix/room/Room.js b/src/matrix/room/Room.js index 158299c3..7d482201 100644 --- a/src/matrix/room/Room.js +++ b/src/matrix/room/Room.js @@ -200,6 +200,10 @@ export class Room extends EventEmitter { get notificationCount() { return this._summary.notificationCount; } + + get highlightCount() { + return this._summary.highlightCount; + } async _getLastEventId() { const lastKey = this._syncWriter.lastMessageKey; diff --git a/src/matrix/room/RoomSummary.js b/src/matrix/room/RoomSummary.js index c97034e4..3f13bd1e 100644 --- a/src/matrix/room/RoomSummary.js +++ b/src/matrix/room/RoomSummary.js @@ -44,7 +44,7 @@ function applySyncResponse(data, roomResponse, membership, isInitialSync, isTime const unreadNotifications = roomResponse.unread_notifications; if (unreadNotifications) { data = data.cloneIfNeeded(); - data.highlightCount = unreadNotifications.highlight_count; + data.highlightCount = unreadNotifications.highlight_count || 0; data.notificationCount = unreadNotifications.notification_count; } @@ -182,6 +182,10 @@ export class RoomSummary { return this._data.notificationCount; } + get highlightCount() { + return this._data.highlightCount; + } + get lastMessage() { return this._data.lastMessageBody; }