Skip to content

Commit

Permalink
core: add inspircd operprefix !/+y channel mode
Browse files Browse the repository at this point in the history
  • Loading branch information
half-duplex committed Jul 30, 2019
1 parent 3b71a04 commit 5a6e372
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sopel/coretasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def handle_names(bot, trigger):
"@": sopel.module.OP,
"&": sopel.module.ADMIN,
"~": sopel.module.OWNER,
"!": sopel.module.OPER,
}

for name in names:
Expand Down Expand Up @@ -248,6 +249,7 @@ def track_modes(bot, trigger):
"o": sopel.module.OP,
"a": sopel.module.ADMIN,
"q": sopel.module.OWNER,
"y": sopel.module.OPER,
}

# Parse modes before doing anything else
Expand Down Expand Up @@ -759,7 +761,7 @@ def recv_whox(bot, trigger):
return LOGGER.warning('While populating `bot.accounts` a WHO response was malformed.')
_, _, channel, user, host, nick, status, account = trigger.args
away = 'G' in status
modes = ''.join([c for c in status if c in '~&@%+'])
modes = ''.join([c for c in status if c in '~&@%+!'])
_record_who(bot, channel, user, host, nick, account, away, modes)


Expand Down Expand Up @@ -789,6 +791,7 @@ def _record_who(bot, channel, user, host, nick, account=None, away=None, modes=N
"@": sopel.module.OP,
"&": sopel.module.ADMIN,
"~": sopel.module.OWNER,
"!": sopel.module.OPER,
}
for c in modes:
priv = priv | mapping[c]
Expand All @@ -806,7 +809,7 @@ def _record_who(bot, channel, user, host, nick, account=None, away=None, modes=N
@sopel.module.unblockable
def recv_who(bot, trigger):
channel, user, host, _, nick, status = trigger.args[1:7]
modes = ''.join([c for c in status if c in '~&@%+'])
modes = ''.join([c for c in status if c in '~&@%+!'])
_record_who(bot, channel, user, host, nick, modes=modes)


Expand Down
9 changes: 8 additions & 1 deletion sopel/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

__all__ = [
# constants
'NOLIMIT', 'VOICE', 'HALFOP', 'OP', 'ADMIN', 'OWNER',
'NOLIMIT', 'VOICE', 'HALFOP', 'OP', 'ADMIN', 'OWNER', 'OPER',
# decorators
'commands',
'echo',
Expand Down Expand Up @@ -75,6 +75,13 @@
.. versionadded:: 4.1
"""

OPER = 32
"""Privilege level for the +y channel permission
Note: Sopel does not track OPER status except through the +y channel mode
.. versionadded:: 7.0.0
"""


def unblockable(function):
"""Decorator which exempts the function from nickname and hostname blocking.
Expand Down

0 comments on commit 5a6e372

Please sign in to comment.