Trigger a /recolor when we set deterministic_nick_colors=true

This commit is contained in:
Florent Le Coz 2015-01-06 01:08:05 +01:00
parent ebbca7e314
commit b6019edfa2

View file

@ -315,6 +315,8 @@ class Core(object):
self.on_password_change)
self.add_configuration_handler("enable_vertical_tab_list",
self.on_vertical_tab_list_config_change)
self.add_configuration_handler("deterministic_nick_colors",
self.on_nick_determinism_changed)
self.add_configuration_handler("", self.on_any_config_change)
@ -405,6 +407,15 @@ class Core(object):
"""
self.xmpp.password = value
def on_nick_determinism_changed(self, option, value):
"""If we change the value to true, we call /recolor on all the MucTabs, to
make the current nick colors reflect their deterministic value.
"""
if value.lower() == "true":
for tab in self.get_tabs(tabs.MucTab):
tab.command_recolor('')
def reload_config(self):
# reload all log files
log.debug("Reloading the log files…")