From f4c51cde0067ae471b5eb7f7103ee3ab816818b4 Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 5 Sep 2017 18:36:37 -0700 Subject: [PATCH] automode: don't send empty mode lines if no users match the ACL --- plugins/automode.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/automode.py b/plugins/automode.py index 7b55700..d0ebe48 100644 --- a/plugins/automode.py +++ b/plugins/automode.py @@ -106,18 +106,19 @@ def match(irc, channel, uids=None): log.debug("(%s) automode: Filtered mode list of %s to %s (protocol:%s)", irc.name, modes, outgoing_modes, irc.protoname) - # If the Automode bot is missing, send the mode through the PyLink server. - if modebot_uid not in irc.users: - modebot_uid = irc.sid + if outgoing_modes: + # If the Automode bot is missing, send the mode through the PyLink server. + if modebot_uid not in irc.users: + modebot_uid = irc.sid - log.debug("(%s) automode: sending modes from modebot_uid %s", - irc.name, modebot_uid) + log.debug("(%s) automode: sending modes from modebot_uid %s", + irc.name, modebot_uid) - irc.proto.mode(modebot_uid, channel, outgoing_modes) + irc.proto.mode(modebot_uid, channel, outgoing_modes) - # Create a hook payload to support plugins like relay. - irc.callHooks([modebot_uid, 'AUTOMODE_MODE', - {'target': channel, 'modes': outgoing_modes, 'parse_as': 'MODE'}]) + # Create a hook payload to support plugins like relay. + irc.callHooks([modebot_uid, 'AUTOMODE_MODE', + {'target': channel, 'modes': outgoing_modes, 'parse_as': 'MODE'}]) def handle_join(irc, source, command, args): """