From dede508e89944a18207e8940b2445bd676193fba Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Fri, 26 Feb 2021 16:46:18 -0500 Subject: [PATCH] Support sending invite reasons Added as the final argument to `invite` in order to keep backwards compatibility. Signed-off-by: Robin Townsend --- src/client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index 5e224a5bf..3edcfe904 100644 --- a/src/client.js +++ b/src/client.js @@ -3447,11 +3447,12 @@ MatrixClient.prototype.getRoomUpgradeHistory = function(roomId, verifyLinks=fals * @param {string} roomId * @param {string} userId * @param {module:client.callback} callback Optional. + * @param {string} reason Optional. * @return {Promise} Resolves: TODO * @return {module:http-api.MatrixError} Rejects: with an error response. */ -MatrixClient.prototype.invite = function(roomId, userId, callback) { - return _membershipChange(this, roomId, userId, "invite", undefined, +MatrixClient.prototype.invite = function(roomId, userId, callback, reason) { + return _membershipChange(this, roomId, userId, "invite", reason, callback); };