forked from External/ergo
move ChannelOperator check into hasPrivs helper
This commit is contained in:
parent
a18283e2de
commit
ac08ce0f20
1 changed files with 2 additions and 3 deletions
|
|
@ -108,7 +108,6 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
|
||||||
// so we only output one warning for each list type when full
|
// so we only output one warning for each list type when full
|
||||||
listFullWarned := make(map[modes.Mode]bool)
|
listFullWarned := make(map[modes.Mode]bool)
|
||||||
|
|
||||||
clientIsOp := channel.ClientIsAtLeast(client, modes.ChannelOperator)
|
|
||||||
var alreadySentPrivError bool
|
var alreadySentPrivError bool
|
||||||
|
|
||||||
applied := make(modes.ModeChanges, 0)
|
applied := make(modes.ModeChanges, 0)
|
||||||
|
|
@ -141,9 +140,9 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
|
||||||
return channel.ClientIsAtLeast(client, change.Mode)
|
return channel.ClientIsAtLeast(client, change.Mode)
|
||||||
case modes.BanMask:
|
case modes.BanMask:
|
||||||
// #163: allow unprivileged users to list ban masks
|
// #163: allow unprivileged users to list ban masks
|
||||||
return clientIsOp || isListOp(change)
|
return isListOp(change) || channel.ClientIsAtLeast(client, modes.ChannelOperator)
|
||||||
default:
|
default:
|
||||||
return clientIsOp
|
return channel.ClientIsAtLeast(client, modes.ChannelOperator)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue