summary refs log tree commit diff
path: root/syweb/webclient/components
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-11-06 11:14:31 +0000
committerKegan Dougal <kegan@matrix.org>2014-11-06 11:14:31 +0000
commita92092340b5de022d1e48ecd4176cfb9b200b4d6 (patch)
tree7a15dc6206ff8c6ef3d25a372aeb74a246a20295 /syweb/webclient/components
parentAdd mRoomName and orderMembersList filter tests. Mark FIXME on broken tests f... (diff)
downloadsynapse-a92092340b5de022d1e48ecd4176cfb9b200b4d6.tar.xz
Fix broken tests which were previously skipped.
Diffstat (limited to 'syweb/webclient/components')
-rw-r--r--syweb/webclient/components/matrix/matrix-filter.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/syweb/webclient/components/matrix/matrix-filter.js b/syweb/webclient/components/matrix/matrix-filter.js
index 4d264e93f3..e84c197c76 100644
--- a/syweb/webclient/components/matrix/matrix-filter.js
+++ b/syweb/webclient/components/matrix/matrix-filter.js
@@ -38,7 +38,7 @@ function($rootScope, matrixService, eventHandlerService, modelService) {
         if (room.state("m.room.join_rules") && room.state("m.room.join_rules").content) {
             isPublicRoom = ("public" === room.state("m.room.join_rules").content.join_rule);
         }
-
+        
         if (room_name_event) {
             roomName = room_name_event.content.name;
         }
@@ -56,6 +56,9 @@ function($rootScope, matrixService, eventHandlerService, modelService) {
                     var member = room.members[i];
                     if (member.state_key !== user_id) {
                         roomName = eventHandlerService.getUserDisplayName(room_id, member.state_key);
+                        if (!roomName) {
+                            roomName = member.state_key;
+                        }
                         break;
                     }
                 }
@@ -70,13 +73,22 @@ function($rootScope, matrixService, eventHandlerService, modelService) {
                     if (room.members[otherUserId].content.membership === "invite") {
                         // someone invited us, use the right ID.
                         roomName = eventHandlerService.getUserDisplayName(room_id, room.members[otherUserId].user_id);
+                        if (!roomName) {
+                            roomName = room.members[otherUserId].user_id;
+                        }
                     }
                     else {
                         roomName = eventHandlerService.getUserDisplayName(room_id, otherUserId);
+                        if (!roomName) {
+                            roomName = user_id;
+                        }
                     }
                 }
                 else { // it isn't us, so use their name if we know it.
                     roomName = eventHandlerService.getUserDisplayName(room_id, otherUserId);
+                    if (!roomName) {
+                        roomName = otherUserId;
+                    }
                 }
             }
             else if (Object.keys(room.members).length === 0) {