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

Add support for new keypair style 3pid invites (add an option to joinRoom for specifying the signing url)

This commit is contained in:
David Baker
2016-02-23 10:11:04 +00:00
parent 363b08c4d8
commit bd600f65fb
2 changed files with 64 additions and 17 deletions

View File

@@ -365,6 +365,34 @@ module.exports.MatrixHttpApi.prototype = {
);
},
/**
* Perform a request to an arbitrary URL.
* @param {Function} callback Optional. The callback to invoke on
* success/failure. See the promise return values for more information.
* @param {string} method The HTTP method e.g. "GET".
* @param {string} uri The HTTP URI
* @param {Object} queryParams A dict of query params (these will NOT be
* urlencoded).
* @param {Object} data The HTTP JSON body.
* @param {Number=} localTimeoutMs The maximum amount of time to wait before
* timing out the request. If not specified, there is no timeout.
* @return {module:client.Promise} Resolves to <code>{data: {Object},
* headers: {Object}, code: {Number}}</code>.
* If <code>onlyData</code> is set, this will resolve to the <code>data</code>
* object only.
* @return {module:http-api.MatrixError} Rejects with an error if a problem
* occurred. This includes network problems and Matrix-specific error JSON.
*/
requestOtherUrl: function(callback, method, uri, queryParams, data,
localTimeoutMs) {
if (!queryParams) {
queryParams = {};
}
return this._request(
callback, method, uri, queryParams, data, localTimeoutMs
);
},
/**
* Form and return a homeserver request URL based on the given path
* params and prefix.