summary refs log tree commit diff
path: root/syweb/webclient/room
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-11-14 11:13:03 +0000
committerKegan Dougal <kegan@matrix.org>2014-11-14 11:13:03 +0000
commit974206ebe1a73a6d9c470b7f02bad74cb37d2e3c (patch)
tree55fa9eb15d7e7d0a631441b0429e9c01aba87c85 /syweb/webclient/room
parentAdd notification-service unit tests. (diff)
downloadsynapse-974206ebe1a73a6d9c470b7f02bad74cb37d2e3c.tar.xz
Use mUserDisplayName filter in more places. Store power_level[norm] for each RoomMember.
Diffstat (limited to 'syweb/webclient/room')
-rw-r--r--syweb/webclient/room/room-controller.js22
1 files changed, 5 insertions, 17 deletions
diff --git a/syweb/webclient/room/room-controller.js b/syweb/webclient/room/room-controller.js
index 67372a804f..9a9381ed98 100644
--- a/syweb/webclient/room/room-controller.js
+++ b/syweb/webclient/room/room-controller.js
@@ -15,8 +15,8 @@ limitations under the License.
 */
 
 angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'angular-peity'])
-.controller('RoomController', ['$modal', '$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall', 'modelService', 'recentsService', 'commandsService',
-                               function($modal, $filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall, modelService, recentsService, commandsService) {
+.controller('RoomController', ['$modal', '$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall', 'modelService', 'recentsService', 'commandsService', 'mUserDisplayNameFilter',
+                               function($modal, $filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall, modelService, recentsService, commandsService, mUserDisplayNameFilter) {
    'use strict';
     var MESSAGES_PER_PAGINATION = 30;
     var THUMBNAIL_SIZE = 320;
@@ -162,24 +162,12 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a
                 $scope.state.waiting_for_joined_event = false;
                 onInit3();
             }
-            else if (event.state_key === $scope.state.user_id && "invite" !== event.membership && "join" !== event.membership) {
-                var user;
-                        
-                if ($scope.members[event.user_id]) {
-                    user = $scope.members[event.user_id].displayname;
-                }
-                if (user) {
-                    user = user + " (" + event.user_id + ")";
-                }
-                else {
-                    user = event.user_id;
-                }
-                 
+            else if (event.state_key === $scope.state.user_id && "invite" !== event.membership && "join" !== event.membership) {    
                 if ("ban" === event.membership) {
-                    $scope.state.permission_denied = "You have been banned by " + user;
+                    $scope.state.permission_denied = "You have been banned by " + mUserDisplayNameFilter(event.user_id);
                 }
                 else {
-                    $scope.state.permission_denied = "You have been kicked by " + user;
+                    $scope.state.permission_denied = "You have been kicked by " + mUserDisplayNameFilter(event.user_id);
                 }  
             }
             else {