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

Update thread replies count to only include m.thread (#1991)

This commit is contained in:
Germain
2021-10-20 16:49:54 +01:00
committed by GitHub
parent f59b81f46b
commit d5ab4ba2ef

View File

@@ -46,7 +46,7 @@ export class Thread extends EventEmitter {
public readonly client: MatrixClient, public readonly client: MatrixClient,
) { ) {
super(); super();
this.timelineSet = new EventTimelineSet(room, { this.timelineSet = new EventTimelineSet(null, {
unstableClientRelationAggregation: true, unstableClientRelationAggregation: true,
timelineSupport: true, timelineSupport: true,
}); });
@@ -135,9 +135,13 @@ export class Thread extends EventEmitter {
/** /**
* The number of messages in the thread * The number of messages in the thread
* Only count rel_type=m.thread as we want to
* exclude annotations from that number
*/ */
public get length(): number { public get length(): number {
return this.events.length; return this.events
.filter(event => event.isThreadRelation)
.length;
} }
/** /**