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

Merge pull request #1000 from matrix-org/t3chguy/remove_authedRequestWithPrefix

Remove deprecated authedRequestWithPrefix and requestWithPrefix
This commit is contained in:
J. Ryan Stinnett
2019-08-06 18:58:24 +01:00
committed by GitHub
4 changed files with 13 additions and 83 deletions

View File

@@ -1369,8 +1369,10 @@ MatrixClient.prototype.getGroups = function() {
* @return {module:client.Promise} Resolves with an object containing the config.
*/
MatrixClient.prototype.getMediaConfig = function(callback) {
return this._http.authedRequestWithPrefix(
callback, "GET", "/config", undefined, undefined, httpApi.PREFIX_MEDIA_R0,
return this._http.authedRequest(
callback, "GET", "/config", undefined, undefined, {
prefix: httpApi.PREFIX_MEDIA_R0,
},
);
};
@@ -2275,11 +2277,13 @@ MatrixClient.prototype.getUrlPreview = function(url, ts, callback) {
}
const self = this;
return this._http.authedRequestWithPrefix(
return this._http.authedRequest(
callback, "GET", "/preview_url", {
url: url,
ts: ts,
}, undefined, httpApi.PREFIX_MEDIA_R0,
}, undefined, {
prefix: httpApi.PREFIX_MEDIA_R0,
},
).then(function(response) {
// TODO: expire cache occasionally
self.urlPreviewCache[key] = response;