From 91dc58d9676323287d8bb7a40adeb6bd225e6bf6 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 2 Jan 2013 17:04:27 -0800 Subject: Fix startup issues with components using caps and vcards. --- sleekxmpp/plugins/xep_0054/vcard_temp.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sleekxmpp/plugins/xep_0054') diff --git a/sleekxmpp/plugins/xep_0054/vcard_temp.py b/sleekxmpp/plugins/xep_0054/vcard_temp.py index 24da1c05..09acd454 100644 --- a/sleekxmpp/plugins/xep_0054/vcard_temp.py +++ b/sleekxmpp/plugins/xep_0054/vcard_temp.py @@ -59,10 +59,20 @@ class XEP_0054(BasePlugin): def make_vcard(self): return VCardTemp() - def get_vcard(self, jid=None, ifrom=None, local=False, cached=False, + def get_vcard(self, jid=None, ifrom=None, local=None, cached=False, block=True, callback=None, timeout=None): - if self.xmpp.is_component and jid.domain == self.xmpp.boundjid.domain: - local = True + if local is None: + if jid is not None and not isinstance(jid, JID): + jid = JID(jid) + if self.xmpp.is_component: + if jid.domain == self.xmpp.boundjid.domain: + local = True + else: + if str(jid) == str(self.xmpp.boundjid): + local = True + jid = jid.full + elif jid in (None, ''): + local = True if local: vcard = self.api['get_vcard'](jid, None, ifrom) -- cgit v1.2.3