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 +++++++++++++--- sleekxmpp/plugins/xep_0115/caps.py | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'sleekxmpp') 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) diff --git a/sleekxmpp/plugins/xep_0115/caps.py b/sleekxmpp/plugins/xep_0115/caps.py index b7a346c0..8bad1410 100644 --- a/sleekxmpp/plugins/xep_0115/caps.py +++ b/sleekxmpp/plugins/xep_0115/caps.py @@ -290,7 +290,7 @@ class XEP_0115(BasePlugin): # can just send a normal presence stanza. If we have, then # we will send presence to each contact individually so # that we don't clobber existing statuses. - directed = False + directed = False or self.xmpp.is_component for contact in self.xmpp.roster[jid]: if self.xmpp.roster[jid][contact].last_status is not None: directed = True -- cgit v1.2.3 From 2c04ae084ca2233f45776b32614b1e575db93449 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Wed, 2 Jan 2013 16:53:16 +0200 Subject: util/sasl/mechanisms.py: SASLMutualAuthFailed not defined SASLMutualAuthFailed was not imported from sleekxmpp.util.sasl.client --- sleekxmpp/util/sasl/mechanisms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/util/sasl/mechanisms.py b/sleekxmpp/util/sasl/mechanisms.py index 80cb7219..e137e263 100644 --- a/sleekxmpp/util/sasl/mechanisms.py +++ b/sleekxmpp/util/sasl/mechanisms.py @@ -21,7 +21,8 @@ from base64 import b64encode, b64decode from sleekxmpp.util import bytes, hash, XOR, quote, num_to_bytes from sleekxmpp.util.sasl.client import sasl_mech, Mech, \ - SASLCancelled, SASLFailed + SASLCancelled, SASLFailed, \ + SASLMutualAuthFailed @sasl_mech(0) -- cgit v1.2.3