1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-17 21:42:17 +03:00

Merge pull request #217 from matrix-org/dbkr/join_3p_location

Add API for 3rd party location lookup
This commit is contained in:
David Baker
2016-09-30 14:32:33 +01:00
committed by GitHub

View File

@@ -1039,6 +1039,39 @@ MatrixBaseApis.prototype.sendToDevice = function(
);
};
// Third party Lookup API
// ======================
/**
* Get the third party protocols that can be reached using
* this HS
* @return {module:client.Promise} Resolves to the result object
*/
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()
* @return {module:client.Promise} Resolves to the result object
*/
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