summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-24 13:17:47 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-24 13:17:47 +0200
commitc7620cca6f9cd5791d3a8955c69eb5a4b3032aff (patch)
tree733b5fe29c0f86117d3d2de9fb7fa6cc40bf31e1
parentFixed SYWEB-28: show displayname changes in recents (diff)
downloadsynapse-c7620cca6f9cd5791d3a8955c69eb5a4b3032aff.tar.xz
SYWEB-27: Public rooms with 2 users must not considered as 1:1 chat room and so, they must no be renamed
-rw-r--r--webclient/components/matrix/matrix-filter.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/webclient/components/matrix/matrix-filter.js b/webclient/components/matrix/matrix-filter.js
index c27746b380..e6f2acc5fd 100644
--- a/webclient/components/matrix/matrix-filter.js
+++ b/webclient/components/matrix/matrix-filter.js
@@ -31,14 +31,21 @@ angular.module('matrixFilter', [])
         if (room) {
             // Get name from room state date
             var room_name_event = room["m.room.name"];
+
+            // Determine if it is a public room
+            var isPublicRoom = false;
+            if (room["m.room.join_rules"] && room["m.room.join_rules"].content) {
+                isPublicRoom = ("public" === room["m.room.join_rules"].content.join_rule);
+            }
+
             if (room_name_event) {
                 roomName = room_name_event.content.name;
             }
             else if (alias) {
                 roomName = alias;
             }
-            else if (room.members) {
-
+            else if (room.members && !isPublicRoom) {    // Do not rename public room
+            
                 var user_id = matrixService.config().user_id;
 
                 // Else, build the name from its users