mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
hide Mod button for muted users
This commit is contained in:
parent
6e3245a3b0
commit
8f83621c4c
1 changed files with 7 additions and 1 deletions
|
@ -322,9 +322,15 @@ module.exports = React.createClass({
|
||||||
(powerLevels.events ? powerLevels.events["m.room.power_levels"] : null) ||
|
(powerLevels.events ? powerLevels.events["m.room.power_levels"] : null) ||
|
||||||
powerLevels.state_default
|
powerLevels.state_default
|
||||||
);
|
);
|
||||||
|
var levelToSend = (
|
||||||
|
(powerLevels.events ? powerLevels.events["m.room.message"] : null) ||
|
||||||
|
powerLevels.events_default
|
||||||
|
);
|
||||||
|
|
||||||
can.kick = me.powerLevel >= powerLevels.kick;
|
can.kick = me.powerLevel >= powerLevels.kick;
|
||||||
can.ban = me.powerLevel >= powerLevels.ban;
|
can.ban = me.powerLevel >= powerLevels.ban;
|
||||||
can.mute = me.powerLevel >= editPowerLevel;
|
can.mute = me.powerLevel >= editPowerLevel;
|
||||||
|
can.toggleMod = me.powerLevel > them.powerLevel && them.powerLevel >= levelToSend;
|
||||||
can.modifyLevel = me.powerLevel > them.powerLevel;
|
can.modifyLevel = me.powerLevel > them.powerLevel;
|
||||||
return can;
|
return can;
|
||||||
},
|
},
|
||||||
|
@ -376,7 +382,7 @@ module.exports = React.createClass({
|
||||||
{muteLabel}
|
{muteLabel}
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
if (this.state.can.modifyLevel) {
|
if (this.state.can.toggleMod) {
|
||||||
var giveOpLabel = this.state.isTargetMod ? "Revoke Moderator" : "Make Moderator";
|
var giveOpLabel = this.state.isTargetMod ? "Revoke Moderator" : "Make Moderator";
|
||||||
giveModButton = <div className="mx_MemberInfo_field" onClick={this.onModToggle}>
|
giveModButton = <div className="mx_MemberInfo_field" onClick={this.onModToggle}>
|
||||||
{giveOpLabel}
|
{giveOpLabel}
|
||||||
|
|
Loading…
Reference in a new issue