Commit 729bed7a authored by louiz’'s avatar louiz’
Browse files

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
parent 1d74d67c
......@@ -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)
......
......@@ -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,
......
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