1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Add getAvatarUrl() to RoomMember

This commit is contained in:
Kegan Dougal
2015-07-02 17:22:44 +01:00
parent 4c48990c1f
commit abe00deb65
2 changed files with 12 additions and 0 deletions

View File

@@ -38,6 +38,17 @@ function RoomMember(roomId, userId) {
}
utils.inherits(RoomMember, EventEmitter);
/**
* Get the avatar URL for this member.
* @return {string|null} the avatar URL or null.
*/
RoomMember.prototype.getAvatarUrl = function() {
if (!this.events.member) {
return null;
}
return this.events.member.getContent().avatar_url || null;
};
/**
* Update this room member's membership event. May fire "RoomMember.name" if
* this event updates this member's name.