forked from mystiq/hydrogen-web
also expose highlight count
This commit is contained in:
parent
0d8ff34c55
commit
831f4188f7
2 changed files with 9 additions and 1 deletions
|
@ -201,6 +201,10 @@ export class Room extends EventEmitter {
|
|||
return this._summary.notificationCount;
|
||||
}
|
||||
|
||||
get highlightCount() {
|
||||
return this._summary.highlightCount;
|
||||
}
|
||||
|
||||
async _getLastEventId() {
|
||||
const lastKey = this._syncWriter.lastMessageKey;
|
||||
if (lastKey) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue