diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-21 15:30:57 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-21 15:31:11 +0100 |
commit | 4c228df167ca1708964c93c3c20e46d631899ce1 (patch) | |
tree | f5749c5bb8949ee1bc456bcaaf51f03f529c9fb0 /webclient/rooms/rooms-controller.js | |
parent | Fixed first pagination detection (diff) | |
download | synapse-4c228df167ca1708964c93c3c20e46d631899ce1.tar.xz |
Use the new 'inviter' key from im sync for room display names.
Diffstat (limited to 'webclient/rooms/rooms-controller.js')
-rw-r--r-- | webclient/rooms/rooms-controller.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/webclient/rooms/rooms-controller.js b/webclient/rooms/rooms-controller.js index c25e24c8bc..f2ff4a25ba 100644 --- a/webclient/rooms/rooms-controller.js +++ b/webclient/rooms/rooms-controller.js @@ -59,7 +59,7 @@ angular.module('RoomsController', ['matrixService', 'mFileInput', 'mFileUpload', // FIXME push membership to top level key to match /im/sync event.membership = event.content.membership; // FIXME bodge a nicer name than the room ID for this invite. - event.room_alias = event.user_id + "'s room"; + event.room_display_name = event.user_id + "'s room"; $scope.rooms[event.room_id] = event; } }); @@ -70,15 +70,20 @@ angular.module('RoomsController', ['matrixService', 'mFileInput', 'mFileUpload', if (alias) { // use the existing alias from storage data[i].room_alias = alias; + data[i].room_display_name = alias; } else if (data[i].aliases && data[i].aliases[0]) { // save the mapping // TODO: select the smarter alias from the array matrixService.createRoomIdToAliasMapping(data[i].room_id, data[i].aliases[0]); + data[i].room_display_name = data[i].aliases[0]; + } + else if (data[i].membership == "invite" && "inviter" in data[i]) { + data[i].room_display_name = data[i].inviter + "'s room" } else { // last resort use the room id - data[i].room_alias = data[i].room_id; + data[i].room_display_name = data[i].room_id; } } return data; |