From 657102e938aeb385cd44daf3cc213a40d58c36fa Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 1 Oct 2012 16:27:55 -0700 Subject: Update legacy auth to be used outside of stream features. Also, add detection of legacy XMPP version. --- sleekxmpp/basexmpp.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sleekxmpp/basexmpp.py') diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 55250751..a1969e34 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -212,6 +212,10 @@ class BaseXMPP(XMLStream): self.stream_version = xml.get('version', '') self.peer_default_lang = xml.get('{%s}lang' % XML_NS, None) + if not self.is_component and not self.stream_version: + log.warning('Legacy XMPP 0.9 protocol detected.') + self.event('legacy_protocol') + def process(self, *args, **kwargs): """Initialize plugins and begin processing the XML stream. -- cgit v1.2.3 From 747a6e94e6039c1e349dafc22d1f3cd2baee6d02 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 15 Oct 2012 22:19:47 -0700 Subject: Auto-subscribe to whitelisted JIDs if auto_subscribe is true --- sleekxmpp/basexmpp.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sleekxmpp/basexmpp.py') diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index a1969e34..f26c048f 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -746,6 +746,8 @@ class BaseXMPP(XMLStream): item = self.roster[pres['to']][pres['from']] if item['whitelisted']: item.authorize() + if roster.auto_subscribe: + item.subscribe() elif roster.auto_authorize: item.authorize() if roster.auto_subscribe: -- cgit v1.2.3