diff --git a/lib/models/user.js b/lib/models/user.js index ce427929f..00e0d4feb 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -77,10 +77,14 @@ User.prototype.setPresenceEvent = function(event) { if (event.getContent().presence !== this.presence || firstFire) { eventsToFire.push("User.presence"); } - if (event.getContent().avatar_url !== this.avatarUrl) { + if (event.getContent().avatar_url && + event.getContent().avatar_url !== this.avatarUrl) + { eventsToFire.push("User.avatarUrl"); } - if (event.getContent().displayname !== this.displayName) { + if (event.getContent().displayname && + event.getContent().displayname !== this.displayName) + { eventsToFire.push("User.displayName"); } @@ -88,7 +92,7 @@ User.prototype.setPresenceEvent = function(event) { if (event.getContent().displayname) { this.displayName = event.getContent().displayname; } - if (event.getContent().avatarUrl) { + if (event.getContent().avatar_url) { this.avatarUrl = event.getContent().avatar_url; } this.lastActiveAgo = event.getContent().last_active_ago;