summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-07-21 18:04:18 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-07-21 18:04:18 +0200
commit1f47557e982b8153df46c1b23e83dbdc7037fcce (patch)
tree62f17eec74f6697a26becabbda791390657e9b28 /src/core
parent729bed7aec6030facc7940dfbbcd37409d2e628e (diff)
downloadpoezio-1f47557e982b8153df46c1b23e83dbdc7037fcce.tar.gz
poezio-1f47557e982b8153df46c1b23e83dbdc7037fcce.tar.bz2
poezio-1f47557e982b8153df46c1b23e83dbdc7037fcce.tar.xz
poezio-1f47557e982b8153df46c1b23e83dbdc7037fcce.zip
Disable/enable carbons immediately when we change the enable_carbons option
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/core.py b/src/core/core.py
index e55a6503..1533695f 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -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…")