diff options
author | Emmanuel ROHEE <erohee@amdocs.com> | 2014-09-03 14:12:56 +0200 |
---|---|---|
committer | Emmanuel ROHEE <erohee@amdocs.com> | 2014-09-03 14:12:56 +0200 |
commit | 4b85c5f52ca5a87fa998d70db81d9f158aa90ada (patch) | |
tree | 6e7185b8468d36eb31694701e0f3fbab111684ab /webclient/room/room-controller.js | |
parent | Updated feedback api docs and fixed feedback content template bug (diff) | |
download | synapse-4b85c5f52ca5a87fa998d70db81d9f158aa90ada.tar.xz |
Added /op $user_id $powerLevel
Diffstat (limited to '')
-rw-r--r-- | webclient/room/room-controller.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 13bddc5451..d96241b863 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -85,6 +85,14 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput']) updatePresence(event); } }); + + $scope.$on(eventHandlerService.POWERLEVEL_EVENT, function(ngEvent, event, isLive) { + if (isLive && event.room_id === $scope.room_id) { + for (var user_id in event.content) { + updateUserPowerLevel(user_id); + } + } + }); $scope.memberCount = function() { return Object.keys($scope.members).length; @@ -278,7 +286,6 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput']) case "/ban": // Ban the user id from the room if (2 <= args.length) { - // TODO: The user may have entered the display name // Need display name -> user_id resolution. Pb: how to manage user with same display names? var user_id = args[1]; @@ -290,6 +297,15 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput']) promise = matrixService.ban($scope.room_id, user_id, reason); } break; + + case "/op": + if (3 === args.length) { + var user_id = args[1]; + var powerLevel = parseInt(args[2]); + + promise = matrixService.setUserPowerLevel($scope.room_id, user_id, powerLevel); + } + break; } } else { |