Skip to content

Commit

Permalink
Fix read receipt sending behaviour around thread roots (#3600)
Browse files Browse the repository at this point in the history
* Fix read receipt sending behaviour around thread roots

* Update src/client.ts

Co-authored-by: Eric Eastwood <erice@element.io>

---------

Co-authored-by: Eric Eastwood <erice@element.io>
  • Loading branch information
t3chguy and MadLittleMods authored Jul 13, 2023
1 parent b186d79 commit b05f933
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5000,9 +5000,11 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
});

if (!unthreaded) {
const isThread = !!event.threadRootId;
// A thread cannot be just a thread root and a thread root can only be read in the main timeline
const isThread = !!event.threadRootId && !event.isThreadRoot;
body = {
...body,
// Only thread replies should define a specific thread. Thread roots can only be read in the main timeline.
thread_id: isThread ? event.threadRootId : MAIN_ROOM_TIMELINE,
};
}
Expand Down

0 comments on commit b05f933

Please sign in to comment.