SYWEB-27: Public rooms with 2 users must not considered as 1:1 chat room and so, they must no be renamed

This commit is contained in:
Emmanuel ROHEE 2014-09-24 13:17:47 +02:00
parent b02bb18a70
commit c7620cca6f
1 changed files with 9 additions and 2 deletions

View File

@ -31,13 +31,20 @@ angular.module('matrixFilter', [])
if (room) { if (room) {
// Get name from room state date // Get name from room state date
var room_name_event = room["m.room.name"]; 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) { if (room_name_event) {
roomName = room_name_event.content.name; roomName = room_name_event.content.name;
} }
else if (alias) { else if (alias) {
roomName = alias; roomName = alias;
} }
else if (room.members) { else if (room.members && !isPublicRoom) { // Do not rename public room
var user_id = matrixService.config().user_id; var user_id = matrixService.config().user_id;