Merge pull request #1042 from GLolol/channel/nicksinprivate

Channel: prevent mass-highlights with 'nicks' by defaulting the output to private
This commit is contained in:
Valentin Lorentz 2015-02-05 08:13:47 +01:00
commit 248bc65d44
2 changed files with 6 additions and 1 deletions

View File

@ -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:

View File

@ -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',