mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 08:02:14 -04:00
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:
parent
7e22afbc7c
commit
828101dd51
5 changed files with 60 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue