You've already forked matrix-js-sdk
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user