summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-07-21 18:02:37 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-07-21 18:02:37 +0200
commit729bed7aec6030facc7940dfbbcd37409d2e628e (patch)
tree587793956c35d6d533fbee0ce70ab560bb79d428 /src/core
parent1d74d67c1e5f56cab1f8a884f3fa71acc3fba3cb (diff)
downloadpoezio-729bed7aec6030facc7940dfbbcd37409d2e628e.tar.gz
poezio-729bed7aec6030facc7940dfbbcd37409d2e628e.tar.bz2
poezio-729bed7aec6030facc7940dfbbcd37409d2e628e.tar.xz
poezio-729bed7aec6030facc7940dfbbcd37409d2e628e.zip
Always register the handlers for carbon, and only once
The handlers are always there, but we only get carbons events when the server sends them to us, which is only when we enabled them. fix #3104
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.py3
-rw-r--r--src/core/handlers.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/core.py b/src/core/core.py
index bd0b8bde..e55a6503 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -249,6 +249,9 @@ class Core(object):
self.xmpp.add_event_handler("attention", self.on_attention)
self.xmpp.add_event_handler("ssl_cert", self.validate_ssl)
self.xmpp.add_event_handler("ssl_invalid_chain", self.ssl_invalid_chain)
+ self.xmpp.add_event_handler('carbon_received', self.on_carbon_received)
+ self.xmpp.add_event_handler('carbon_sent', self.on_carbon_sent)
+
self.all_stanzas = Callback('custom matcher',
connection.MatchAll(None),
self.incoming_stanza)
diff --git a/src/core/handlers.py b/src/core/handlers.py
index 56ff7b42..6572bca4 100644
--- a/src/core/handlers.py
+++ b/src/core/handlers.py
@@ -103,8 +103,6 @@ def on_session_start_features(self, _):
if (config.get('enable_carbons') and
'urn:xmpp:carbons:2' in features):
self.xmpp.plugin['xep_0280'].enable()
- self.xmpp.add_event_handler('carbon_received', self.on_carbon_received)
- self.xmpp.add_event_handler('carbon_sent', self.on_carbon_sent)
self.check_bookmark_storage(features)
self.xmpp.plugin['xep_0030'].get_info(jid=self.xmpp.boundjid.domain,