You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
Add explicit options to disable pending events (#1993)
This commit is contained in:
@@ -38,7 +38,7 @@ export class Thread extends EventEmitter {
|
||||
/**
|
||||
* A reference to all the events ID at the bottom of the threads
|
||||
*/
|
||||
public readonly timelineSet: EventTimelineSet;
|
||||
public readonly timelineSet;
|
||||
|
||||
constructor(
|
||||
events: MatrixEvent[] = [],
|
||||
@@ -46,9 +46,14 @@ export class Thread extends EventEmitter {
|
||||
public readonly client: MatrixClient,
|
||||
) {
|
||||
super();
|
||||
this.timelineSet = new EventTimelineSet(null, {
|
||||
if (events.length === 0) {
|
||||
throw new Error("Can't create an empty thread");
|
||||
}
|
||||
|
||||
this.timelineSet = new EventTimelineSet(this.room, {
|
||||
unstableClientRelationAggregation: true,
|
||||
timelineSupport: true,
|
||||
pendingEvents: false,
|
||||
});
|
||||
events.forEach(event => this.addEvent(event));
|
||||
}
|
||||
@@ -93,14 +98,6 @@ export class Thread extends EventEmitter {
|
||||
this.emit(ThreadEvent.Update, this);
|
||||
}
|
||||
|
||||
private async decryptEvents(): Promise<void> {
|
||||
await Promise.allSettled(
|
||||
Array.from(this.timelineSet.getLiveTimeline().getEvents()).map(event => {
|
||||
return this.client.decryptEventIfNeeded(event, {});
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds an event by ID in the current thread
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user