1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Merge pull request #1028 from matrix-org/travis/hidden_rr

Support hidden read receipts
This commit is contained in:
Travis Ralston
2019-09-10 10:55:58 -06:00
committed by GitHub
2 changed files with 37 additions and 7 deletions

View File

@@ -993,10 +993,13 @@ MatrixBaseApis.prototype.roomInitialSync = function(roomId, limit, callback) {
* @param {string} rrEventId ID of the event tracked by the read receipt. This is here
* for convenience because the RR and the RM are commonly updated at the same time as
* each other. Optional.
* @param {object} opts Options for the read markers.
* @param {object} opts.hidden True to hide the read receipt from other users. <b>This
* property is currently unstable and may change in the future.</b>
* @return {module:client.Promise} Resolves: the empty object, {}.
*/
MatrixBaseApis.prototype.setRoomReadMarkersHttpRequest =
function(roomId, rmEventId, rrEventId) {
function(roomId, rmEventId, rrEventId, opts) {
const path = utils.encodeUri("/rooms/$roomId/read_markers", {
$roomId: roomId,
});
@@ -1004,6 +1007,7 @@ MatrixBaseApis.prototype.setRoomReadMarkersHttpRequest =
const content = {
"m.fully_read": rmEventId,
"m.read": rrEventId,
"m.hidden": Boolean(opts ? opts.hidden : false),
};
return this._http.authedRequest(