Add a "." shortcut to /set in order to set the section for the current tab JID

e.g. /set . notify_messages false would set the option for a section
named after the current tab.
This commit is contained in:
mathieui 2015-04-13 14:31:35 +02:00
parent c8caccc9a1
commit 83113d42fc
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -603,7 +603,15 @@ def command_set(self, args):
plugin_config = self.plugin_manager.plugins[plugin_name].config
info = plugin_config.set_and_save(option, value, section)
else:
section = args[0]
if args[0] == '.':
name = safeJID(self.current_tab().name).bare
if not name:
self.information(_('Invalid tab to use the "." argument.'),
_('Error'))
return
section = name
else:
section = args[0]
option = args[1]
value = args[2]
info = config.set_and_save(option, value, section)