mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-29 13:42:33 +00:00
Set the room_alias field when we encounter a new one, rather than only from local storage.
This commit is contained in:
parent
cde6bdfa77
commit
dd2ae64120
@ -525,7 +525,6 @@ angular.module('matrixService', [])
|
|||||||
room_alias: undefined,
|
room_alias: undefined,
|
||||||
room_display_name: undefined
|
room_display_name: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
var alias = this.getRoomIdToAliasMapping(room.room_id);
|
var alias = this.getRoomIdToAliasMapping(room.room_id);
|
||||||
if (alias) {
|
if (alias) {
|
||||||
// use the existing alias from storage
|
// use the existing alias from storage
|
||||||
@ -539,6 +538,7 @@ angular.module('matrixService', [])
|
|||||||
// TODO: select the smarter alias from the array
|
// TODO: select the smarter alias from the array
|
||||||
this.createRoomIdToAliasMapping(room.room_id, room.aliases[0]);
|
this.createRoomIdToAliasMapping(room.room_id, room.aliases[0]);
|
||||||
result.room_display_name = room.aliases[0];
|
result.room_display_name = room.aliases[0];
|
||||||
|
result.room_alias = room.aliases[0];
|
||||||
}
|
}
|
||||||
else if (room.membership === "invite" && "inviter" in room) {
|
else if (room.membership === "invite" && "inviter" in room) {
|
||||||
result.room_display_name = room.inviter + "'s room";
|
result.room_display_name = room.inviter + "'s room";
|
||||||
@ -551,7 +551,6 @@ angular.module('matrixService', [])
|
|||||||
},
|
},
|
||||||
|
|
||||||
createRoomIdToAliasMapping: function(roomId, alias) {
|
createRoomIdToAliasMapping: function(roomId, alias) {
|
||||||
//console.log("creating mapping between " + roomId + " and " + alias);
|
|
||||||
roomIdToAlias[roomId] = alias;
|
roomIdToAlias[roomId] = alias;
|
||||||
aliasToRoomId[alias] = roomId;
|
aliasToRoomId[alias] = roomId;
|
||||||
// localStorage.setItem(MAPPING_PREFIX+roomId, alias);
|
// localStorage.setItem(MAPPING_PREFIX+roomId, alias);
|
||||||
|
Loading…
Reference in New Issue
Block a user