summary refs log tree commit diff
path: root/webclient/room/room-controller.js
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-02 11:54:11 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-02 11:54:35 +0200
commit828101dd5145d462add4900340874ea2147da994 (patch)
tree30c74fce2f819c899afe995674b287bb02ec4db7 /webclient/room/room-controller.js
parentEnsure that event source unit tests could cope with get_new_events_for_user()... (diff)
downloadsynapse-828101dd5145d462add4900340874ea2147da994.tar.xz
Represent user power level in a room by a red bar at the bottom of his avatar image. The width of this bar depends on the power level.
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r--webclient/room/room-controller.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index d9ada744eb..1f90472c67 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -233,6 +233,13 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
         }
     };
 
+    var updateUserPowerLevel = function(user_id) {
+        var member = $scope.members[user_id];
+        if (member) {
+            member.powerLevel = matrixService.getUserPowerLevel($scope.room_id, user_id);
+        }
+    }
+
     $scope.send = function() {
         if ($scope.textInput === "") {
             return;
@@ -382,6 +389,9 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
                 for (var i = 0; i < response.data.chunk.length; i++) {
                     var chunk = response.data.chunk[i];
                     updateMemberList(chunk);
+
+                    // Add his power level
+                    updateUserPowerLevel(chunk.user_id);
                 }
 
                 // Arm list timing update timer