Sudo: revert previous fix and add a more convenient one.

master
Valentin Lorentz 2011-12-01 19:51:21 +01:00
parent 955edae3aa
commit 16da22d231
1 changed files with 1 additions and 5 deletions

View File

@ -190,16 +190,12 @@ class Sudo(callbacks.Plugin):
if name is None:
log.warning('Sudo not granted to "%s"' % msg.prefix)
irc.error(_('Sudo not granted.'))
elif __builtins__['any']([(x in msg.nick) for x in bannedChars]):
log.warning(('Prevent "%s" from using Sudo because there are banned'
'characters in his nick.') % msg.prefix)
irc.error(_('You are not allowed to use Sudo because you have '
'banned characters in your nick'))
else:
assert rule is not None
log.info('Sudo granted to "%s" with rule %s' % (msg.prefix, name))
msg.prefix = rule.hostmask
tokens = callbacks.tokenize(command)
msg.nick = msg.prefix.split('!')[0]
self.Proxy(irc.irc, msg, tokens)
sudo = wrap(sudo, ['text'])