m_commonchans: Replace IsOper() with HasPrivPermission() instead.

This commit is contained in:
Robby 2019-04-02 05:11:26 +02:00 committed by Peter Powell
parent bdded70ac2
commit 15b93b6c20
2 changed files with 4 additions and 3 deletions

View File

@ -23,10 +23,10 @@
# - users/auspex: allows opers with this priv to view more details about users than normal users, e.g. real host and IP.
# - users/channel-spy: allows opers with this priv to view the private/secret channels that a user is on.
# - servers/auspex: allows opers with this priv to see more details about server information than normal users.
# ACTIONS:
# ACTIONS:
# - users/mass-message: allows opers with this priv to PRIVMSG and NOTICE to a server mask (e.g. NOTICE $*).
# - users/samode-usermodes: allows opers with this priv to change the user modes of any other user using /SAMODE.
# PERMISSIONS:
# PERMISSIONS:
# - channels/ignore-noctcp: allows opers with this priv to send a CTCP to a +C channel.
# - channels/ignore-nonicks: allows opers with this priv to change their nick when on a +N channel.
# - channels/restricted-create: allows opers with this priv to create channels if the restrictchans module is loaded.
@ -34,6 +34,7 @@
# - users/flood/no-throttle: allows opers with this priv to send commands without being throttled (*NOTE).
# - users/flood/increased-buffers: allows opers with this priv to send and receive data without worrying about being disconnected for exceeding limits (*NOTE).
# - users/callerid-override: allows opers with this priv to message people using callerid without being on their callerid list.
# - users/ignore-commonchans: allows opers with this priv to send a message to a +c user without sharing common channels.
# - users/ignore-noctcp: allows opers with this priv to send a CTCP to a +T user.
# - users/sajoin-others: allows opers with this priv to /SAJOIN users other than themselves.
# - servers/use-disabled-commands: allows opers with this priv to use disabled commands.

View File

@ -38,7 +38,7 @@ class ModulePrivacyMode : public Module
if (target.type == MessageTarget::TYPE_USER)
{
User* t = target.Get<User>();
if (!user->IsOper() && (t->IsModeSet(pm)) && (!user->server->IsULine()) && !user->SharesChannelWith(t))
if (!user->HasPrivPermission("users/ignore-commonchans") && (t->IsModeSet(pm)) && (!user->server->IsULine()) && !user->SharesChannelWith(t))
{
user->WriteNumeric(ERR_CANTSENDTOUSER, t->nick, "You are not permitted to send private messages to this user (+c set)");
return MOD_RES_DENY;