You've already forked matrix-js-sdk
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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user