mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-30 11:09:56 +00:00
Fix ordering error in Iq._set_stanza_values.
If iq['query'] was set before a plugin that used the query element was set, then the query element was duplicated.
This commit is contained in:
parent
c6ac40c476
commit
ba0d699d83
1 changed files with 26 additions and 0 deletions
|
@ -199,3 +199,29 @@ class Iq(RootStanza):
|
||||||
return waitfor.wait(timeout)
|
return waitfor.wait(timeout)
|
||||||
else:
|
else:
|
||||||
return StanzaBase.send(self)
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue