1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

make room summary available to Room

from either the sync accumulator or the /sync endpoint
This commit is contained in:
Bruno Windels
2018-07-23 18:38:14 +02:00
parent 21ba4f71f6
commit 8fa87f8ba5
4 changed files with 35 additions and 0 deletions

View File

@@ -823,6 +823,7 @@ SyncApi.prototype._processSyncResponse = async function(
// state: { events: [] },
// timeline: { events: [], prev_batch: $token, limited: true },
// ephemeral: { events: [] },
// summary: { m.heros: [ $userId ], m.joined_member_count: $count }
// account_data: { events: [] },
// unread_notifications: {
// highlight_count: 0,
@@ -1056,6 +1057,13 @@ SyncApi.prototype._processSyncResponse = async function(
self._processRoomEvents(room, stateEvents, timelineEvents);
// set summary after processing events,
// because it will trigger a name calculation
// which needs the room state to be up to date
if (joinObj.summary) {
room.setSummary(joinObj.summary);
}
// XXX: should we be adding ephemeralEvents to the timeline?
// It feels like that for symmetry with room.addAccountData()
// there should be a room.addEphemeralEvents() or similar.