Fix the componentxmpp interface

This commit is contained in:
mathieui 2015-02-12 12:11:50 +01:00
parent 957c635fb7
commit 8b36e918e8
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -55,7 +55,7 @@ class ComponentXMPP(BaseXMPP):
BaseXMPP.__init__(self, jid, default_ns)
self.auto_authorize = None
self.stream_header = "<stream:stream %s %s to='%s'>" % (
self.stream_header = '<stream:stream %s %s to="%s">' % (
'xmlns="jabber:component:accept"',
'xmlns:stream="%s"' % self.stream_ns,
jid)
@ -68,6 +68,8 @@ class ComponentXMPP(BaseXMPP):
self.plugin_whitelist = plugin_whitelist
self.is_component = True
self.sessionstarted = False
self.register_handler(
Callback('Handshake',
MatchXPath('{jabber:component:accept}handshake'),
@ -145,7 +147,7 @@ class ComponentXMPP(BaseXMPP):
:param xml: The reply handshake stanza.
"""
self.session_bind_event.set()
self.session_started_event.set()
self.sessionstarted = True
self.event('session_bind', self.boundjid)
self.event('session_start')