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

Stop checking for event type as it is sometimes encrypted

This commit is contained in:
Germain Souquet
2021-08-10 16:21:59 +02:00
parent 18113900fe
commit e5a67500e4
2 changed files with 6 additions and 5 deletions

View File

@@ -1086,6 +1086,10 @@ export class Room extends EventEmitter {
}); });
} }
public getThread(eventId: string): Thread {
return this.threads.get(eventId);
}
/** /**
* Build the reply chain starting from the bottom up * Build the reply chain starting from the bottom up
*/ */

View File

@@ -21,7 +21,6 @@ export class Thread {
private root: string; private root: string;
public tail = new Set<string>(); public tail = new Set<string>();
private events = new Map<string, MatrixEvent>(); private events = new Map<string, MatrixEvent>();
private _messageCount = 0;
constructor(events: MatrixEvent[] = []) { constructor(events: MatrixEvent[] = []) {
events.forEach(event => this.addEvent(event)); events.forEach(event => this.addEvent(event));
@@ -83,7 +82,7 @@ export class Thread {
* The number of messages in the thread * The number of messages in the thread
*/ */
public get length(): number { public get length(): number {
return this._messageCount; return this.eventTimeline.length;
} }
/** /**
@@ -92,9 +91,7 @@ export class Thread {
public get participants(): Set<string> { public get participants(): Set<string> {
const participants = new Set<string>(); const participants = new Set<string>();
this.events.forEach(event => { this.events.forEach(event => {
if (event.getType() === EventType.RoomMessage) { participants.add(event.getSender());
participants.add(event.getSender());
}
}); });
return participants; return participants;
} }