diff --git a/skins/base/views/molecules/ChangeAvatar.js b/skins/base/views/molecules/ChangeAvatar.js index 808da629..a374f0ff 100644 --- a/skins/base/views/molecules/ChangeAvatar.js +++ b/skins/base/views/molecules/ChangeAvatar.js @@ -33,7 +33,7 @@ module.exports = React.createClass({ onError: function(error) { this.setState({ - errorText: "Failed to set profile picture!" + errorText: "Failed to upload profile picture!" }); }, diff --git a/src/TextForEvent.js b/src/TextForEvent.js index d3a38fcd..224ffe4e 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -13,7 +13,7 @@ function textForMemberEvent(ev) { return senderName + " banned " + targetName + "." + reason; case 'join': if (ev.getPrevContent() && ev.getPrevContent().membership == 'join') { - if (ev.getPrevContent().displayname && ev.getContent().displayname) { + if (ev.getPrevContent().displayname && ev.getContent().displayname && ev.getPrevContent().displayname != ev.getContent().displayname) { return ev.getSender() + " changed their display name from " + ev.getPrevContent().displayname + " to " + ev.getContent().displayname; @@ -23,7 +23,7 @@ function textForMemberEvent(ev) { return ev.getSender() + " removed their display name"; } else if (ev.getPrevContent().avatar_url && !ev.getContent().avatar_url) { return ev.getSender() + " removed their profile picture"; - } else if (ev.getPrevContent().avatar_url && ev.getContent().avatar_url) { + } else if (ev.getPrevContent().avatar_url && ev.getContent().avatar_url && ev.getPrevContent().avatar_url != ev.getContent().avatar_url) { return ev.getSender() + " changed their profile picture"; } else if (!ev.getPrevContent().avatar_url && ev.getContent().avatar_url) { return ev.getSender() + " set a profile picture"; diff --git a/src/controllers/molecules/ChangeAvatar.js b/src/controllers/molecules/ChangeAvatar.js index 0b25c15d..72a541b1 100644 --- a/src/controllers/molecules/ChangeAvatar.js +++ b/src/controllers/molecules/ChangeAvatar.js @@ -55,9 +55,7 @@ module.exports = { var self = this; MatrixClientPeg.get().uploadContent(file).then(function(url) { newUrl = url; - return MatrixClientPeg.get().setProfileInfo('avatar_url', { - avatar_url: url - }); + return MatrixClientPeg.get().setAvatarUrl(url); }).done(function() { self.setState({ phase: self.Phases.Display, diff --git a/src/controllers/organisms/UserSettings.js b/src/controllers/organisms/UserSettings.js index 80056b23..3f5b980e 100644 --- a/src/controllers/organisms/UserSettings.js +++ b/src/controllers/organisms/UserSettings.js @@ -50,16 +50,6 @@ module.exports = { ); }, - changeAvatarUrl: function(new_avatar_url) { - if (this.state.avatarUrl == new_avatar_url) return; - - var self = this; - return MatrixClientPeg.get().setAvatarUrl(new_avatar_url).then( - function() { self.setState({displayName: new_displayname}); }, - function(err) { console.err(err); } - ); - }, - componentWillMount: function() { var self = this; var cli = MatrixClientPeg.get();