From f177919625353fb7de42bbf02b68a89d72232e01 Mon Sep 17 00:00:00 2001 From: mal Date: Sun, 28 Jul 2019 22:46:13 +0000 Subject: [PATCH 1/3] core: add inspircd operprefix !/+y channel mode --- sopel/coretasks.py | 7 +++++-- sopel/module.py | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 7b19007831..7f0f35b7e8 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -299,6 +299,7 @@ def handle_names(bot, trigger): "@": module.OP, "&": module.ADMIN, "~": module.OWNER, + "!": module.OPER, } for name in names: @@ -361,6 +362,7 @@ def track_modes(bot, trigger): "o": module.OP, "a": module.ADMIN, "q": module.OWNER, + "y": module.OPER, } # Parse modes before doing anything else @@ -904,7 +906,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) @@ -935,6 +937,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] @@ -952,7 +955,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) diff --git a/sopel/module.py b/sopel/module.py index afb5af6cfe..f36a4bd9e5 100644 --- a/sopel/module.py +++ b/sopel/module.py @@ -15,7 +15,7 @@ __all__ = [ # constants - 'NOLIMIT', 'VOICE', 'HALFOP', 'OP', 'ADMIN', 'OWNER', + 'NOLIMIT', 'VOICE', 'HALFOP', 'OP', 'ADMIN', 'OWNER', 'OPER', # decorators 'action_commands', 'commands', @@ -81,6 +81,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): """Decorate a function to exempt it from the ignore/blocks system. From a2664ca22a1cb64f0cf2cc9b44b7ba35e3ff1c6f Mon Sep 17 00:00:00 2001 From: mal Date: Sat, 3 Aug 2019 17:20:33 +0000 Subject: [PATCH 2/3] core: add inspircd ojoin +Y channel mode Co-Authored-By: Humorous Baby --- sopel/coretasks.py | 1 + sopel/module.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 7f0f35b7e8..bb9689734b 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -363,6 +363,7 @@ def track_modes(bot, trigger): "a": module.ADMIN, "q": module.OWNER, "y": module.OPER, + "Y": module.OPER, } # Parse modes before doing anything else diff --git a/sopel/module.py b/sopel/module.py index f36a4bd9e5..bb383aec99 100644 --- a/sopel/module.py +++ b/sopel/module.py @@ -82,8 +82,8 @@ """ OPER = 32 -"""Privilege level for the +y channel permission -Note: Sopel does not track OPER status except through the +y channel mode +"""Privilege level for the +y/+Y channel permissions +Note: Sopel does not track OPER status except through these channel modes .. versionadded:: 7.0.0 """ From 02d1638f84fe20e4c40d4bf9b02e64a49202667e Mon Sep 17 00:00:00 2001 From: dgw Date: Sun, 3 Nov 2019 23:48:07 -0600 Subject: [PATCH 3/3] module: fix/tweak OPER constant's docstring --- sopel/module.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sopel/module.py b/sopel/module.py index bb383aec99..e59fc9d6f2 100644 --- a/sopel/module.py +++ b/sopel/module.py @@ -83,7 +83,9 @@ OPER = 32 """Privilege level for the +y/+Y channel permissions -Note: Sopel does not track OPER status except through these channel modes + +Note: Except for these (non-standard) channel modes, Sopel does not monitor or +store any user's OPER status. .. versionadded:: 7.0.0 """