Skip to content

Commit

Permalink
Associate event with thread before adding it to the thread timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Feb 20, 2023
1 parent 89df43a commit b7286b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/models/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {

const { shouldLiveInRoom, threadId } = this.eventShouldLiveIn(remoteEvent);
const thread = threadId ? this.getThread(threadId) : null;
thread?.setEventMetadata(localEvent);
thread?.timelineSet.handleRemoteEcho(localEvent, oldEventId, newEventId);

if (shouldLiveInRoom) {
Expand Down Expand Up @@ -2548,6 +2549,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {

const { shouldLiveInRoom, threadId } = this.eventShouldLiveIn(event);
const thread = threadId ? this.getThread(threadId) : undefined;
thread?.setEventMetadata(event);
thread?.timelineSet.replaceEventId(oldEventId, newEventId!);

if (shouldLiveInRoom) {
Expand Down

0 comments on commit b7286b7

Please sign in to comment.