mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 07:04:56 -04:00
Use modelService to access room member power levels rather than RoomController.
This commit is contained in:
parent
974206ebe1
commit
49a1b4262d
3 changed files with 4 additions and 48 deletions
|
@ -41,6 +41,7 @@ angular.module('modelService', [])
|
|||
this.room_id = room_id;
|
||||
this.old_room_state = new RoomState();
|
||||
this.current_room_state = new RoomState();
|
||||
this.now = this.current_room_state; // makes html access shorter
|
||||
this.events = []; // events which can be displayed on the UI. TODO move?
|
||||
};
|
||||
Room.prototype = {
|
||||
|
@ -125,7 +126,7 @@ angular.module('modelService', [])
|
|||
// normalise power levels: find the max first.
|
||||
var maxPowerLevel = 0;
|
||||
for (var user_id in event.content) {
|
||||
if (!event.content.hasOwnProperty(user_id)) continue;
|
||||
if (!event.content.hasOwnProperty(user_id) || user_id === "hsob_ts") continue; // XXX hsob_ts on some old rooms :(
|
||||
maxPowerLevel = Math.max(maxPowerLevel, event.content[user_id]);
|
||||
}
|
||||
// set power level f.e room member
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue