From 7243367a64c1cb3f8acd33bcde2ad578a016c5bf Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 1 Jun 2016 03:45:16 +0100 Subject: [PATCH] only clobber displayname & avatarurl from presence if set. fixes https://github.com/vector-im/vector-web/issues/1039. again. --- lib/models/user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/models/user.js b/lib/models/user.js index 11ac274f6..ce427929f 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -85,8 +85,12 @@ User.prototype.setPresenceEvent = function(event) { } this.presence = event.getContent().presence; - this.displayName = event.getContent().displayname; - this.avatarUrl = event.getContent().avatar_url; + if (event.getContent().displayname) { + this.displayName = event.getContent().displayname; + } + if (event.getContent().avatarUrl) { + this.avatarUrl = event.getContent().avatar_url; + } this.lastActiveAgo = event.getContent().last_active_ago; this.lastPresenceTs = Date.now(); this.currentlyActive = event.getContent().currently_active;