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

Argument Length Check, Duplicate Fix for Redact Funcation

This commit is contained in:
jkasun
2019-04-13 22:23:57 +05:30
parent c495b12cef
commit 348c293962

View File

@@ -1,23 +1,3 @@
/**
* @param {string} roomId
* @param {string} eventId
* @param {string=} txnId transaction id. One will be made up if not
* supplied.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixBaseApis.prototype.redactEvent = function(
roomId, eventId, txnId, callback,
) {
const path = utils.encodeUri("/rooms/$roomId/redact/$eventId/$tnxId", {
$roomId: roomId,
$eventId: eventId,
$txnId: txnId ? txnId : this.makeTxnId(),
});
return this._http.authedRequest(callback, "PUT", path, undefined, {});
};
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
@@ -920,6 +900,10 @@ MatrixBaseApis.prototype.sendStateEvent = function(roomId, eventType, content, s
MatrixBaseApis.prototype.redactEvent = function(
roomId, eventId, txnId, callback,
) {
if (arguments.length === 3) {
callback = txnId;
}
const path = utils.encodeUri("/rooms/$roomId/redact/$eventId/$tnxId", {
$roomId: roomId,
$eventId: eventId,