Commit 1f47557e authored by louiz’'s avatar louiz’

Disable/enable carbons immediately when we change the enable_carbons option

parent 729bed7a
......@@ -319,6 +319,8 @@ class Core(object):
self.on_vertical_tab_list_config_change)
self.add_configuration_handler("deterministic_nick_colors",
self.on_nick_determinism_changed)
self.add_configuration_handler("enable_carbons",
self.on_carbons_switch)
self.add_configuration_handler("", self.on_any_config_change)
......@@ -427,6 +429,16 @@ class Core(object):
for tab in self.get_tabs(tabs.MucTab):
tab.command_recolor('')
def on_carbons_switch(self, option, value):
"""Whenever the user enables or disables carbons using /set, we should
inform the server immediately, this way we do not require a restart
for the change to take effect
"""
if value:
self.xmpp.plugin['xep_0280'].enable()
else:
self.xmpp.plugin['xep_0280'].disable()
def reload_config(self):
# reload all log files
log.debug("Reloading the log files…")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment