mirror of https://github.com/vector-im/riot-web
Remove now unused MatrixTools.GetRoomForAlias
parent
d8dedae084
commit
4d5fbfc5b1
|
@ -24,30 +24,5 @@ module.exports = {
|
|||
getDisplayAliasForRoom: function(room) {
|
||||
return room.getCanonicalAlias() || room.getAliases()[0];
|
||||
},
|
||||
|
||||
/**
|
||||
* Given a list of room objects, return the room which has the given alias,
|
||||
* else null.
|
||||
*/
|
||||
getRoomForAlias: function(rooms, room_alias) {
|
||||
var room;
|
||||
for (var i = 0; i < rooms.length; i++) {
|
||||
var aliasEvents = rooms[i].currentState.getStateEvents(
|
||||
"m.room.aliases"
|
||||
);
|
||||
for (var j = 0; j < aliasEvents.length; j++) {
|
||||
var aliases = aliasEvents[j].getContent().aliases || [];
|
||||
for (var k = 0; k < aliases.length; k++) {
|
||||
if (aliases[k] === room_alias) {
|
||||
room = rooms[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (room) { break; }
|
||||
}
|
||||
if (room) { break; }
|
||||
}
|
||||
return room || null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue