You've already forked matrix-js-sdk
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:
@@ -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) {
|
if (!member.events.member) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var rawUrl = member.events.member.getContent().avatar_url;
|
var rawUrl = member.events.member.getContent().avatar_url;
|
||||||
if (rawUrl) {
|
if (rawUrl) {
|
||||||
return this._http.getHttpUriForMxc(rawUrl);
|
return this._http.getHttpUriForMxc(rawUrl, width, height, resizeMethod);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user