summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-01-13 22:16:46 -0500
committerLance Stout <lancestout@gmail.com>2011-01-13 22:16:46 -0500
commit65931bb384aada922c5287a3ad3cc62d04d6e676 (patch)
tree27297893f7cfa3be0dff1c4be5c81dbbfab6fcb0 /sleekxmpp/stanza
parenta5d53b3349dc1488da57a7b02758ab1063b4560c (diff)
parent632827f213235ab33f08dc133cf50b2c9287cfd0 (diff)
downloadslixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.tar.gz
slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.tar.bz2
slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.tar.xz
slixmpp-65931bb384aada922c5287a3ad3cc62d04d6e676.zip
Merge branch 'develop' into roster
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r--sleekxmpp/stanza/iq.py26
1 files changed, 26 insertions, 0 deletions
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
+