1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-18 05:42:00 +03:00

Add jsdoc and pass through other params

This commit is contained in:
David Baker
2015-07-02 18:29:35 +01:00
parent f29f2a8115
commit 04272a66f0

View File

@@ -692,13 +692,23 @@ MatrixClient.prototype.setAvatarUrl = function(url, callback) {
);
};
MatrixClient.prototype.getAvatarUrlForMember = function(member, width, height, resizeMethod) {
/**
* Get the avatar URL for a room member.
* @param {module:room-member.RoomMember} member
* @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.getAvatarUrlForMember =
function(member, width, height, resizeMethod) {
if (!member.events.member) {
return null;
}
var rawUrl = member.events.member.getContent().avatar_url;
if (rawUrl) {
return this._http.getHttpUriForMxc(rawUrl);
return this._http.getHttpUriForMxc(rawUrl, width, height, resizeMethod);
}
return null;
};