Skip to content

Commit 7064f1c

Browse files
committed
Add an option to not send read receipts.
Note that currently Riot clients use the read receipts to mark a room as read. So disabling them will have the downside that the rooms will stay as unread on Riot clients. It will also prevent synapse to dismiss notifications if any. See: https://matrix.to/#/!DgvjtOljKujDBrxyHk:matrix.org/$150940327657oICsH:riot.ovh
1 parent 8b78cc1 commit 7064f1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

matrix.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,11 @@ function MatrixServer:SendReadMarker(room_id, event_id)
13121312
postfields = {}
13131313
}
13141314
data.postfields['m.fully_read'] = event_id
1315-
data.postfields['m.read'] = event_id
1315+
1316+
if w.config_get_plugin('read_receipts') == 'on' then
1317+
data.postfields['m.read'] = event_id
1318+
end
1319+
13161320
data.postfields = json.encode(data.postfields)
13171321
http(url,
13181322
data,
@@ -3326,6 +3330,7 @@ if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT
33263330
encrypted_message_color = {'lightgreen', 'Print encrypted mesages with this color'},
33273331
--olm_secret = {'', 'Password used to secure olm stores'},
33283332
timeout = {'5', 'Time in seconds until a connection is assumed to be timed out'},
3333+
read_receipts = {'on', 'Send read receipts. Note that not sending them will prevent a room to be marked as read in Riot clients.'}
33293334
}
33303335
-- set default settings
33313336
for option, value in pairs(settings) do

0 commit comments

Comments
 (0)