Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add inspircd operprefix !/+y channel mode #1671

Merged
merged 3 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sopel/coretasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def handle_names(bot, trigger):
"@": module.OP,
"&": module.ADMIN,
"~": module.OWNER,
"!": module.OPER,
}

for name in names:
Expand Down Expand Up @@ -361,6 +362,8 @@ def track_modes(bot, trigger):
"o": module.OP,
"a": module.ADMIN,
"q": module.OWNER,
"y": module.OPER,
"Y": module.OPER,
}

# Parse modes before doing anything else
Expand Down Expand Up @@ -904,7 +907,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 @@ -935,6 +938,7 @@ def _record_who(bot, channel, user, host, nick, account=None, away=None, modes=N
"@": module.OP,
"&": module.ADMIN,
"~": module.OWNER,
"!": module.OPER,
}
for c in modes:
priv = priv | mapping[c]
Expand All @@ -952,7 +956,7 @@ def _record_who(bot, channel, user, host, nick, account=None, away=None, modes=N
def recv_who(bot, trigger):
channel, user, host, _, nick, status = trigger.args[1:7]
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, away=away, modes=modes)


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

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

OPER = 32
"""Privilege level for the +y/+Y channel permissions

Note: Except for these (non-standard) channel modes, Sopel does not monitor or
store any user's OPER status.

.. versionadded:: 7.0.0
"""


def unblockable(function):
"""Decorate a function to exempt it from the ignore/blocks system.
Expand Down