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.

This commit is contained in:
Emmanuel ROHEE 2014-09-02 11:54:11 +02:00
parent 7e22afbc7c
commit 828101dd51
5 changed files with 60 additions and 0 deletions

View file

@ -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