mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 13:31:35 +03:00
Allow sending hidden RRs
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
181a23d259
commit
226224b039
3 changed files with 14 additions and 2 deletions
|
@ -758,16 +758,20 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
this.lastRMSentEventId = this.state.readMarkerEventId;
|
this.lastRMSentEventId = this.state.readMarkerEventId;
|
||||||
|
|
||||||
|
const roomId = this.props.timelineSet.room.roomId;
|
||||||
|
const hiddenRR = !SettingsStore.getValue("sendReadReceipts", roomId);
|
||||||
|
|
||||||
debuglog('TimelinePanel: Sending Read Markers for ',
|
debuglog('TimelinePanel: Sending Read Markers for ',
|
||||||
this.props.timelineSet.room.roomId,
|
this.props.timelineSet.room.roomId,
|
||||||
'rm', this.state.readMarkerEventId,
|
'rm', this.state.readMarkerEventId,
|
||||||
lastReadEvent ? 'rr ' + lastReadEvent.getId() : '',
|
lastReadEvent ? 'rr ' + lastReadEvent.getId() : '',
|
||||||
|
' hidden:' + hiddenRR,
|
||||||
);
|
);
|
||||||
MatrixClientPeg.get().setRoomReadMarkers(
|
MatrixClientPeg.get().setRoomReadMarkers(
|
||||||
this.props.timelineSet.room.roomId,
|
roomId,
|
||||||
this.state.readMarkerEventId,
|
this.state.readMarkerEventId,
|
||||||
lastReadEvent, // Could be null, in which case no RR is sent
|
lastReadEvent, // Could be null, in which case no RR is sent
|
||||||
{},
|
{ hidden: hiddenRR },
|
||||||
).catch((e) => {
|
).catch((e) => {
|
||||||
// /read_markers API is not implemented on this HS, fallback to just RR
|
// /read_markers API is not implemented on this HS, fallback to just RR
|
||||||
if (e.errcode === 'M_UNRECOGNIZED' && lastReadEvent) {
|
if (e.errcode === 'M_UNRECOGNIZED' && lastReadEvent) {
|
||||||
|
|
|
@ -74,6 +74,7 @@ export default class LabsUserSettingsTab extends React.Component {
|
||||||
<SettingsFlag name="showHiddenEventsInTimeline" level={SettingLevel.DEVICE} />
|
<SettingsFlag name="showHiddenEventsInTimeline" level={SettingLevel.DEVICE} />
|
||||||
<SettingsFlag name="lowBandwidth" level={SettingLevel.DEVICE} />
|
<SettingsFlag name="lowBandwidth" level={SettingLevel.DEVICE} />
|
||||||
<SettingsFlag name="advancedRoomListLogging" level={SettingLevel.DEVICE} />
|
<SettingsFlag name="advancedRoomListLogging" level={SettingLevel.DEVICE} />
|
||||||
|
<SettingsFlag name={"sendReadReceipts"} level={SettingLevel.ACCOUNT} />
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,6 +325,13 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
"sendReadReceipts": {
|
||||||
|
supportedLevels: LEVELS_ROOM_SETTINGS,
|
||||||
|
displayName: _td(
|
||||||
|
"Send read receipts for messages (requires compatible homeserver to disable)",
|
||||||
|
),
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
"baseFontSize": {
|
"baseFontSize": {
|
||||||
displayName: _td("Font size"),
|
displayName: _td("Font size"),
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
|
|
Loading…
Reference in a new issue