diff options
Diffstat (limited to 'sleekxmpp/componentxmpp.py')
-rw-r--r-- | sleekxmpp/componentxmpp.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py index 8c380ddc..8f7cfeaf 100644 --- a/sleekxmpp/componentxmpp.py +++ b/sleekxmpp/componentxmpp.py @@ -58,7 +58,7 @@ class ComponentXMPP(BaseXMPP): default_ns = 'jabber:client' else: default_ns = 'jabber:component:accept' - BaseXMPP.__init__(self, default_ns) + BaseXMPP.__init__(self, jid, default_ns) self.auto_authorize = None self.stream_header = "<stream:stream %s %s to='%s'>" % ( @@ -68,8 +68,8 @@ class ComponentXMPP(BaseXMPP): self.stream_footer = "</stream:stream>" self.server_host = host self.server_port = port - self.set_jid(jid) self.secret = secret + self.plugin_config = plugin_config self.plugin_whitelist = plugin_whitelist self.is_component = True @@ -78,6 +78,8 @@ class ComponentXMPP(BaseXMPP): Callback('Handshake', MatchXPath('{jabber:component:accept}handshake'), self._handle_handshake)) + self.add_event_handler('presence_probe', + self._handle_probe) def connect(self): """ @@ -140,3 +142,8 @@ class ComponentXMPP(BaseXMPP): """ self.session_started_event.set() self.event("session_start") + + def _handle_probe(self, presence): + pto = presence['to'].bare + pfrom = presence['from'].bare + self.roster[pto][pfrom].handle_probe(presence) |