diff --git a/lib/base-apis.js b/lib/base-apis.js index ed0bffbe2..cf259008a 100644 --- a/lib/base-apis.js +++ b/lib/base-apis.js @@ -1039,6 +1039,37 @@ MatrixBaseApis.prototype.sendToDevice = function( ); }; +// Third party Lookup API +// ====================== + +/* + * Get the third party protocols that can be reached using + * this HS + */ +MatrixBaseApis.prototype.getThirdpartyProtocols = function() { + return this._http.authedRequestWithPrefix( + undefined, "GET", "/thirdparty/protocols", undefined, undefined, + httpApi.PREFIX_UNSTABLE + ); +}; + +/* + * 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 + * response to getThirdpartyProtocols() + */ +MatrixBaseApis.prototype.getThirdpartyLocation = function(protocol, params) { + var path = utils.encodeUri("/thirdparty/location/$protocol", { + $protocol: protocol + }); + + return this._http.authedRequestWithPrefix( + undefined, "GET", path, params, undefined, + httpApi.PREFIX_UNSTABLE + ); +}; /** * MatrixBaseApis object