Skip to content

Commit

Permalink
Add a flag to track user participation in a thread (matrix-org#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
germain-gg authored and skyka13711 committed Apr 14, 2022
1 parent 2a4f5bc commit cf177b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/models/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export class Thread extends BaseModel<ThreadEvent> {
this._currentUserParticipated = true;
}

if (this.ready) {
this.client.decryptEventIfNeeded(event, {});
}

await this.client.decryptEventIfNeeded(event, {});
this.emit(ThreadEvent.Update, this);
}
Expand Down Expand Up @@ -187,4 +191,8 @@ export class Thread extends BaseModel<ThreadEvent> {
public has(eventId: string): boolean {
return this.timelineSet.findEventById(eventId) instanceof MatrixEvent;
}

public get hasCurrentUserParticipated(): boolean {
return this._currentUserParticipated;
}
}

0 comments on commit cf177b0

Please sign in to comment.