From c06ed4598368a15a7c0f77aaca2dfb5a4743703d Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 1 Feb 2015 20:52:00 -0500 Subject: [PATCH] Channel: prevent mass-highlights with 'nicks' by defaulting the output to private This adds a new config variable plugins.Channel.nicksInPrivate. Cherry-picked from commit GLolol@2cc9e9d. --- plugins/Channel/config.py | 4 ++++ plugins/Channel/plugin.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/Channel/config.py b/plugins/Channel/config.py index a126b8640..19f7462be 100644 --- a/plugins/Channel/config.py +++ b/plugins/Channel/config.py @@ -47,6 +47,10 @@ Channel = conf.registerPlugin('Channel') conf.registerChannelValue(Channel, 'alwaysRejoin', registry.Boolean(True, _("""Determines whether the bot will always try to rejoin a channel whenever it's kicked from the channel."""))) +conf.registerChannelValue(Channel, 'nicksInPrivate', + registry.Boolean(True, _("""Determines whether the output of 'nicks' will + be sent in private. This prevents mass-highlights of a channel's users, + accidental or on purpose."""))) # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/plugins/Channel/plugin.py b/plugins/Channel/plugin.py index c2b010bed..75834daa2 100644 --- a/plugins/Channel/plugin.py +++ b/plugins/Channel/plugin.py @@ -910,7 +910,8 @@ class Channel(callbacks.Plugin): keys = [option for (option, arg) in optlist] if 'count' not in keys: utils.sortBy(str.lower, L) - irc.reply(utils.str.commaAndify(L)) + private = self.registryValue("nicksInPrivate", channel) + irc.reply(utils.str.commaAndify(L), private=private) else: irc.reply(str(len(L))) nicks = wrap(nicks, ['inChannel',