diff --git a/src/Avatar.js b/src/Avatar.js index 74b279c6..a5b59a72 100644 --- a/src/Avatar.js +++ b/src/Avatar.js @@ -19,16 +19,6 @@ limitations under the License. var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); module.exports = { - avatarUrlForMember: function(member, width, height, resizeMethod) { - var url = MatrixClientPeg.get().getAvatarUrlForMember( - member, width, height, resizeMethod, false - ); - if (url === null) { - url = this.defaultAvatarUrlForString(member.userId); - } - return url; - }, - defaultAvatarUrlForString: function(s) { var total = 0; for (var i = 0; i < s.length; ++i) { diff --git a/src/skins/vector/views/atoms/MemberAvatar.js b/src/skins/vector/views/atoms/MemberAvatar.js index bd20723d..69652e1a 100644 --- a/src/skins/vector/views/atoms/MemberAvatar.js +++ b/src/skins/vector/views/atoms/MemberAvatar.js @@ -17,6 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); +var Avatar = require('../../../../Avatar'); var MemberAvatarController = require('matrix-react-sdk/lib/controllers/atoms/MemberAvatar') @@ -24,6 +25,20 @@ module.exports = React.createClass({ displayName: 'MemberAvatar', mixins: [MemberAvatarController], + avatarUrlForMember: function(member) { + return Avatar.avatarUrlForMember( + member, + this.props.member, + this.props.width, + this.props.height, + this.props.resizeMethod + ); + }, + + skinnedDefaultAvatarUrl: function(member, width, height, resizeMethod) { + return Avatar.defaultAvatarUrlForString(member.userId); + }, + render: function() { return (