1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Read receipt HTTP API tweaks

This commit is contained in:
Kegan Dougal
2015-10-16 09:36:13 +01:00
parent 6679e93afc
commit 43fc200dae

View File

@@ -1125,8 +1125,9 @@ MatrixClient.prototype.sendHtmlNotice = function(roomId, body, htmlBody, callbac
};
/**
* @param {Event} event
* @param {string} receiptType
* Send a receipt.
* @param {Event} event The event being acknowledged
* @param {string} receiptType The kind of receipt e.g. "m.read"
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
@@ -1137,11 +1138,22 @@ MatrixClient.prototype.sendReceipt = function(event, receiptType, callback) {
$receiptType: receiptType,
$eventId: event.getId()
});
return this._http.authedRequest(
callback, "POST", path, undefined, {}
return this._http.authedRequestWithPrefix(
callback, "POST", path, undefined, {}, httpApi.PREFIX_V2_ALPHA
);
};
/**
* Send a read receipt.
* @param {Event} event The event that has been read.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendReadReceipt = function(event, callback) {
return this.sendReceipt(event, "m.read", callback);
};
/**
* Upload a file to the media repository on the home server.