Config: Also tell about current channel value in @help if it is different from the global one. Closes GH-581.

This commit is contained in:
Valentin Lorentz 2014-04-03 11:47:24 +00:00
parent 4d9a8a1408
commit 36568aa849

View File

@ -239,7 +239,18 @@ class Config(callbacks.Plugin):
s = group.help()
if s:
if hasattr(group, 'value') and not group._private:
s += _(' (Current value: %s)') % group
channel = msg.args[0]
if irc.isChannel(channel):
globvalue = str(group)
chanvalue = str(group.get(channel))
if chanvalue != globvalue:
s += _(' (Current global value: %s; '
'current channel value: %s)') % \
(globvalue, chanvalue)
else:
s += _(' (Current value: %s)') % group
else:
s += _(' (Current value: %s)') % group
irc.reply(s)
else:
irc.reply(_('That configuration group exists, but seems to '