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>
(cherry picked from commit b05f933)
  • Loading branch information
t3chguy authored and github-actions[bot] committed Jul 14, 2023
1 parent dcf71e0 commit d4628e7
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 @@ -4992,9 +4992,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 d4628e7

Please sign in to comment.