diff options
author | Lance Stout <lancestout@gmail.com> | 2011-01-13 22:16:46 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-01-13 22:16:46 -0500 |
commit | 65931bb384aada922c5287a3ad3cc62d04d6e676 (patch) | |
tree | 27297893f7cfa3be0dff1c4be5c81dbbfab6fcb0 | |
parent | a5d53b3349dc1488da57a7b02758ab1063b4560c (diff) | |
parent | 632827f213235ab33f08dc133cf50b2c9287cfd0 (diff) | |
download | slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.tar.gz slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.tar.bz2 slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.tar.xz slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.zip |
Merge branch 'develop' into roster
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | sleekxmpp/plugins/old_0004.py | 2 | ||||
-rw-r--r-- | sleekxmpp/stanza/iq.py | 26 | ||||
-rw-r--r-- | sleekxmpp/xmlstream/jid.py | 2 |
4 files changed, 31 insertions, 3 deletions
@@ -46,7 +46,9 @@ packages = [ 'sleekxmpp', 'sleekxmpp/thirdparty',
'sleekxmpp/plugins',
'sleekxmpp/plugins/xep_0030',
- 'sleekxmpp/plugins/xep_0030/stanza'
+ 'sleekxmpp/plugins/xep_0030/stanza',
+ 'sleekxmpp/plugins/xep_0059',
+ 'sleekxmpp/plugins/xep_0092',
]
if sys.version_info < (3, 0):
diff --git a/sleekxmpp/plugins/old_0004.py b/sleekxmpp/plugins/old_0004.py index ade3d682..7f086866 100644 --- a/sleekxmpp/plugins/old_0004.py +++ b/sleekxmpp/plugins/old_0004.py @@ -6,7 +6,7 @@ See the file LICENSE for copying permission. """ from . import base -import log +import logging from xml.etree import cElementTree as ET import copy import logging diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py index 906e6648..6388346c 100644 --- a/sleekxmpp/stanza/iq.py +++ b/sleekxmpp/stanza/iq.py @@ -199,3 +199,29 @@ class Iq(RootStanza): return waitfor.wait(timeout) else: return StanzaBase.send(self) + + def _set_stanza_values(self, values): + """ + Set multiple stanza interface values using a dictionary. + + Stanza plugin values may be set usind nested dictionaries. + + If the interface 'query' is given, then it will be set + last to avoid duplication of the <query /> element. + + Overrides ElementBase._set_stanza_values. + + Arguments: + values -- A dictionary mapping stanza interface with values. + Plugin interfaces may accept a nested dictionary that + will be used recursively. + """ + query = values.get('query', '') + if query: + del values['query'] + StanzaBase._set_stanza_values(self, values) + self['query'] = query + else: + StanzaBase._set_stanza_values(self, values) + return self + diff --git a/sleekxmpp/xmlstream/jid.py b/sleekxmpp/xmlstream/jid.py index e5c49dc0..5019a25e 100644 --- a/sleekxmpp/xmlstream/jid.py +++ b/sleekxmpp/xmlstream/jid.py @@ -71,7 +71,7 @@ class JID(object): if self._domain is None: self._domain = self._jid.split('@', 1)[-1].split('/', 1)[0] return self._domain or "" - elif name == 'full': + elif name in ('full', 'jid'): return self._jid or "" elif name == 'bare': if self._bare is None: |