1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

add mxc -> http uri conversion func to client

This commit is contained in:
David Baker
2015-07-07 13:39:37 +01:00
parent e706dcd861
commit e2768ceba2

View File

@@ -713,6 +713,20 @@ MatrixClient.prototype.getAvatarUrlForMember =
return null;
};
/**
* Turn an MXC URL into an HTP one
* @param {string} mxcUrl The MXC URL
* @param {Number} width The desired width of the thumbnail.
* @param {Number} height The desired height of the thumbnail.
* @param {string} resizeMethod The thumbnail resize method to use, either
* "crop" or "scale".
* @return {?string} the avatar URL or null.
*/
MatrixClient.prototype.mxcUrlToHttp =
function(mxcUrl, width, height, resizeMethod) {
return this._http.getHttpUriForMxc(mxcUrl, width, height, resizeMethod);
};
/**
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO