Emit thread update after event decryption (#2040)

This commit is contained in:
Germain
2021-11-30 14:40:59 +00:00
committed by GitHub
parent db9936e07c
commit 4f4811e1d9
2 changed files with 2 additions and 11 deletions
+1 -1
View File
@@ -1748,7 +1748,7 @@ export class Room extends EventEmitter {
// types X Y Z to the timeline".
this.addLiveEvent(events[i], duplicateStrategy, fromCache);
const thread = this.threads.get(events[i].getId());
if (thread && !thread.ready) {
if (thread) {
thread.addEvent(events[i], true);
}
}
+1 -10
View File
@@ -107,9 +107,7 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
this._currentUserParticipated = true;
}
if (this.ready) {
this.client.decryptEventIfNeeded(event, {});
}
await this.client.decryptEventIfNeeded(event, {});
this.emit(ThreadEvent.Update, this);
}
@@ -129,13 +127,6 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
return threadReplies[threadReplies.length - 1];
}
/**
* Determines thread's ready status
*/
public get ready(): boolean {
return this.rootEvent !== undefined;
}
/**
* The thread ID, which is the same as the root event ID
*/