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

Add API for 3rd party location lookup

This commit is contained in:
David Baker
2016-09-29 15:50:00 +01:00
parent b784d1a5e7
commit fa557eb0cc

View File

@@ -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