summary refs log tree commit diff
path: root/webclient/room
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-11-03 10:23:14 +0000
committerKegan Dougal <kegan@matrix.org>2014-11-03 10:23:14 +0000
commit395bb64b2677465cdb6bd2dc2d659dd59f583e8a (patch)
tree729f0eae8bdf0d959b5e8d0b2172fea8c81fc7d7 /webclient/room
parentPrevent EventStreamService from knowing too much about the EventHandlerServic... (diff)
downloadsynapse-395bb64b2677465cdb6bd2dc2d659dd59f583e8a.tar.xz
Keep matrixService stateless and make matrixFilter use modelService.
Diffstat (limited to 'webclient/room')
-rw-r--r--webclient/room/room-controller.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index b5f2b60419..38158ffc74 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -404,7 +404,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
     var updateUserPowerLevel = function(user_id) {
         var member = $scope.members[user_id];
         if (member) {
-            member.powerLevel = matrixService.getUserPowerLevel($scope.room_id, user_id);
+            member.powerLevel = eventHandlerService.getUserPowerLevel($scope.room_id, user_id);
             
             normaliseMembersPowerLevels();
         }
@@ -576,7 +576,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
                                 powerLevel = parseInt(matches[3]);
                             }
                             if (powerLevel !== NaN) {
-                                promise = matrixService.setUserPowerLevel($scope.room_id, user_id, powerLevel);
+                                var powerLevelEvent = $scope.room.current_room_state.state("m.room.power_levels");
+                                promise = matrixService.setUserPowerLevel($scope.room_id, user_id, powerLevel, powerLevelEvent);
                             }
                         }
                     }
@@ -591,7 +592,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
                     if (args) {
                         var matches = args.match(/^(\S+)$/);
                         if (matches) {
-                            promise = matrixService.setUserPowerLevel($scope.room_id, args, undefined);
+                            var powerLevelEvent = $scope.room.current_room_state.state("m.room.power_levels");
+                            promise = matrixService.setUserPowerLevel($scope.room_id, args, undefined, powerLevelEvent);
                         }
                     }
                     
@@ -1005,7 +1007,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
         $scope.event_selected = content;
         // scope this so the template can check power levels and enable/disable
         // buttons
-        $scope.pow = matrixService.getUserPowerLevel;
+        $scope.pow = eventHandlerService.getUserPowerLevel;
 
         var modalInstance = $modal.open({
             templateUrl: 'eventInfoTemplate.html',