From 9a53fa3876e5ec86321f0c405e9f83090a998d99 Mon Sep 17 00:00:00 2001 From: Johannes Bornhold Date: Sun, 31 Dec 2017 01:24:27 +0100 Subject: [PATCH 1/2] Fix typo around getThirdpartyLocation --- src/base-apis.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base-apis.js b/src/base-apis.js index 3ae681917..2b8578d2d 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -1668,7 +1668,7 @@ MatrixBaseApis.prototype.getThirdpartyProtocols = function() { * Get information on how a specific place on a third party protocol * may be reached. * @param {string} protocol The protocol given in getThirdpartyProtocols() - * @param {object} params Protocol-specific parameters, as given in th + * @param {object} params Protocol-specific parameters, as given in the * response to getThirdpartyProtocols() * @return {module:client.Promise} Resolves to the result object */ From 81de2b3afc47b7157eed358d92805c1453474148 Mon Sep 17 00:00:00 2001 From: Johannes Bornhold Date: Sun, 31 Dec 2017 01:24:55 +0100 Subject: [PATCH 2/2] Add getThirdpartyUser Signed-off-by: Johannes Bornhold --- src/base-apis.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/base-apis.js b/src/base-apis.js index 2b8578d2d..b8f6a156f 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -1683,6 +1683,25 @@ MatrixBaseApis.prototype.getThirdpartyLocation = function(protocol, params) { ); }; +/** + * Get information on how a specific user on a third party protocol + * may be reached. + * @param {string} protocol The protocol given in getThirdpartyProtocols() + * @param {object} params Protocol-specific parameters, as given in the + * response to getThirdpartyProtocols() + * @return {module:client.Promise} Resolves to the result object + */ +MatrixBaseApis.prototype.getThirdpartyUser = function(protocol, params) { + const path = utils.encodeUri("/thirdparty/user/$protocol", { + $protocol: protocol, + }); + + return this._http.authedRequestWithPrefix( + undefined, "GET", path, params, undefined, + httpApi.PREFIX_UNSTABLE, + ); +}; + /** * MatrixBaseApis object */