Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 096dff4

Browse files
authored
Merge pull request #3395 from matrix-org/travis/hidden_rr
Support sending hidden read receipts
2 parents c6f3ca2 + e29184a commit 096dff4

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

src/components/structures/TimelinePanel.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,20 +685,26 @@ const TimelinePanel = createReactClass({
685685
}
686686
this.lastRMSentEventId = this.state.readMarkerEventId;
687687

688+
const roomId = this.props.timelineSet.room.roomId;
689+
const hiddenRR = !SettingsStore.getValue("sendReadReceipts", roomId);
690+
688691
debuglog('TimelinePanel: Sending Read Markers for ',
689692
this.props.timelineSet.room.roomId,
690693
'rm', this.state.readMarkerEventId,
691694
lastReadEvent ? 'rr ' + lastReadEvent.getId() : '',
695+
' hidden:' + hiddenRR,
692696
);
693697
MatrixClientPeg.get().setRoomReadMarkers(
694698
this.props.timelineSet.room.roomId,
695699
this.state.readMarkerEventId,
696700
lastReadEvent, // Could be null, in which case no RR is sent
701+
{hidden: hiddenRR},
697702
).catch((e) => {
698703
// /read_markers API is not implemented on this HS, fallback to just RR
699704
if (e.errcode === 'M_UNRECOGNIZED' && lastReadEvent) {
700705
return MatrixClientPeg.get().sendReadReceipt(
701706
lastReadEvent,
707+
{hidden: hiddenRR},
702708
).catch((e) => {
703709
console.error(e);
704710
this.lastRRSentEventId = undefined;

src/components/views/settings/tabs/user/LabsUserSettingsTab.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default class LabsUserSettingsTab extends React.Component {
5454
<SettingsFlag name={"enableWidgetScreenshots"} level={SettingLevel.ACCOUNT} />
5555
<SettingsFlag name={"showHiddenEventsInTimeline"} level={SettingLevel.DEVICE} />
5656
<SettingsFlag name={"lowBandwidth"} level={SettingLevel.DEVICE} />
57+
<SettingsFlag name={"sendReadReceipts"} level={SettingLevel.ACCOUNT} />
5758
</div>
5859
</div>
5960
);

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
"Show hidden events in timeline": "Show hidden events in timeline",
368368
"Low bandwidth mode": "Low bandwidth mode",
369369
"Allow fallback call assist server turn.matrix.org when your homeserver does not offer one (your IP address would be shared during a call)": "Allow fallback call assist server turn.matrix.org when your homeserver does not offer one (your IP address would be shared during a call)",
370+
"Send read receipts for messages (requires compatible homeserver to disable)": "Send read receipts for messages (requires compatible homeserver to disable)",
370371
"Collecting app version information": "Collecting app version information",
371372
"Collecting logs": "Collecting logs",
372373
"Uploading report": "Uploading report",

src/settings/Settings.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,4 +394,11 @@ export const SETTINGS = {
394394
// This is a tri-state value, where `null` means "prompt the user".
395395
default: null,
396396
},
397+
"sendReadReceipts": {
398+
supportedLevels: LEVELS_ROOM_SETTINGS,
399+
displayName: _td(
400+
"Send read receipts for messages (requires compatible homeserver to disable)",
401+
),
402+
default: true,
403+
},
397404
};

0 commit comments

Comments
 (0)