From 36568aa849fa03eb45dd69614cee7c2a3a1d05c8 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 3 Apr 2014 11:47:24 +0000 Subject: [PATCH] Config: Also tell about current channel value in @help if it is different from the global one. Closes GH-581. --- plugins/Config/plugin.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/Config/plugin.py b/plugins/Config/plugin.py index d7fa3e435..128731ad6 100644 --- a/plugins/Config/plugin.py +++ b/plugins/Config/plugin.py @@ -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 '