mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
User.list: add config value plugins.User.listInPrivate to force user list response to be sent in private
This prevents mass-highlights of people who use their IRC nick as their bot username.
This commit is contained in:
parent
b375390bca
commit
3b1c56bbcd
@ -43,8 +43,9 @@ def configure(advanced):
|
||||
|
||||
|
||||
User = conf.registerPlugin('User')
|
||||
# This is where your configuration variables (if any) should go. For example:
|
||||
# conf.registerGlobalValue(User, 'someConfigVariableName',
|
||||
# registry.Boolean(False, """Help for someConfigVariableName."""))
|
||||
conf.registerGlobalValue(User, 'listInPrivate',
|
||||
registry.Boolean(True, _("""Determines whether the output of 'user list'
|
||||
will be sent in private. This prevents mass-highlights of people who use
|
||||
their nick as their bot username.""")))
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
@ -88,7 +88,8 @@ class User(callbacks.Plugin):
|
||||
users.append(u.name)
|
||||
if users:
|
||||
utils.sortBy(str.lower, users)
|
||||
irc.reply(format('%L', users))
|
||||
private = self.registryValue("listInPrivate")
|
||||
irc.reply(format('%L', users), private=private)
|
||||
else:
|
||||
if predicates:
|
||||
irc.reply(_('There are no matching registered users.'))
|
||||
|
Loading…
Reference in New Issue
Block a user