summary refs log tree commit diff
path: root/webclient/room/room-controller.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-10-31 11:56:36 +0000
committerKegan Dougal <kegan@matrix.org>2014-10-31 11:56:36 +0000
commit71ef8f0636428ec08aa4ec5394cac2cbb77fd96b (patch)
tree49e63bcdb2a0bbcd1b72a7b3cbf2324febda3da0 /webclient/room/room-controller.js
parentFactor out notification logic. (diff)
downloadsynapse-71ef8f0636428ec08aa4ec5394cac2cbb77fd96b.tar.xz
SYWEB-102: Fix desktop notification msg when a user with no display name joins a room.
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r--webclient/room/room-controller.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index 45638acaa6..486ead0da9 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -201,11 +201,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
                 // Notify when a user joins
                 if ((document.hidden  || matrixService.presence.unavailable === mPresence.getState())
                         && event.state_key !== $scope.state.user_id  && "join" === event.membership) {
-                        
+                    var userName = event.content.displayname;
+                    if (!userName) {
+                        userName = event.state_key;
+                    }
                     notificationService.showNotification(
-                        event.content.displayname +
+                        userName +
                         " (" + (matrixService.getRoomIdToAliasMapping(event.room_id) || event.room_id) + ")",
-                        event.content.displayname + " joined",
+                        userName + " joined",
                         event.content.avatar_url ? event.content.avatar_url : undefined,
                         function() {
                             console.log("notification.onclick() room=" + event.room_id);