1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

Add context to explain why we fetch roomstate in threads

This commit is contained in:
Germain Souquet
2021-09-22 17:36:12 +01:00
parent f8ec445ff0
commit c748aebfc5
2 changed files with 5 additions and 1 deletions

View File

@@ -515,7 +515,7 @@ export class EventTimelineSet extends EventEmitter {
* @param {MatrixEvent} event Event to be added
* @param {string?} duplicateStrategy 'ignore' or 'replace'
* @param {boolean} fromCache whether the sync response came from cache
* @param {boolean} fromCache whether the sync response came from cache
* @param roomState the state events to reconcile metadata from
*/
public addLiveEvent(
event: MatrixEvent,

View File

@@ -73,6 +73,10 @@ export class Thread extends EventEmitter {
this.root = event.getId();
}
// all the relevant membership info to hydrate events with a sender
// is held in the main room timeline
// We want to fetch the room state from there and pass it down to this thread
// timeline set to let it reconcile an event with its relevant RoomMember
const roomState = this.room.getLiveTimeline().getState(EventTimeline.FORWARDS);
event.setThread(this);