diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index 2e618d6bece..5cf8f4a9b6e 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -242,10 +242,11 @@ export default class ThreadView extends React.Component { { this.state.thread && ( { } private indexForEventId(evId: string): number | null { - for (let i = 0; i < this.state.events.length; ++i) { - if (evId == this.state.events[i].getId()) { - return i; - } + /* Threads do not have server side support for read receipts and the concept + is very tied to the main room timeline, we are forcing the timeline to + send read receipts for threaded events */ + const isThreadTimeline = this.context.timelineRenderingType === TimelineRenderingType.Thread; + if (SettingsStore.getValue("feature_thread") && isThreadTimeline) { + return 0; } - return null; + const index = this.state.events.findIndex(ev => ev.getId() === evId); + return index > -1 + ? index + : null; } private getLastDisplayedEventIndex(opts: IEventIndexOpts = {}): number | null { diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 12ab121b9d3..8cf59a2d5d0 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -1294,6 +1294,7 @@ export default class EventTile extends React.Component { case TileShape.Thread: { const room = this.context.getRoom(this.props.mxEvent.getRoomId()); return React.createElement(this.props.as || "li", { + "ref": this.ref, "className": classes, "aria-live": ariaLive, "aria-atomic": true,