also expose highlight count

This commit is contained in:
Bruno Windels 2020-08-21 15:50:32 +02:00
parent 0d8ff34c55
commit 831f4188f7
2 changed files with 9 additions and 1 deletions

View file

@ -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;

View file

@ -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;
}