summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-09-23 16:39:41 +0100
committerMatthew Hodgson <matthew@matrix.org>2014-09-23 17:31:13 +0100
commit5aa13b9084435e8113edade74597486548e7967b (patch)
tree5b118215826fec8ec63880f2a26033b1efb147c7
parentFix SYWEB-72 : Improve performance when typing. (diff)
downloadsynapse-5aa13b9084435e8113edade74597486548e7967b.tar.xz
fix a case of rampaging SYWEB-78
-rw-r--r--webclient/components/matrix/matrix-filter.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/webclient/components/matrix/matrix-filter.js b/webclient/components/matrix/matrix-filter.js
index 1a64dc126c..8e667d65fb 100644
--- a/webclient/components/matrix/matrix-filter.js
+++ b/webclient/components/matrix/matrix-filter.js
@@ -68,6 +68,9 @@ angular.module('matrixFilter', [])
                     else {
                         // The other member may be in the invite list, get all invited users
                         var invitedUserIDs = [];
+                        
+                        // XXX: *SURELY* we shouldn't have to trawl through the whole messages list to
+                        // find invite - surely the other user should be in room.members with state invited? :/ --Matthew
                         for (var i in room.messages) {
                             var message = room.messages[i];
                             if ("m.room.member" === message.type && "invite" === message.membership) {
@@ -90,6 +93,8 @@ angular.module('matrixFilter', [])
                             otherUserId = invitedUserIDs[0];
                         }
                     }
+                    
+                    if (!otherUserId) otherUserId = user_id; // name the room after ourselves as we're the only person there!
 
                     // Try to resolve his displayname in presence global data
                     if (otherUserId in $rootScope.presence) {