summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-05-31 10:59:14 -0700
committerLance Stout <lancestout@gmail.com>2011-05-31 10:59:14 -0700
commit5ed27bf5f65f03e14da24a60e261a175074cb7aa (patch)
treec79db47352f003b51459016df699032b51712292 /sleekxmpp/stanza
parent62bdaab7c7fc5a35c83ac9f3b0bf5b393f0eb925 (diff)
parenta81162edd2434756e21d7f9a79d71d770a43db7b (diff)
downloadslixmpp-5ed27bf5f65f03e14da24a60e261a175074cb7aa.tar.gz
slixmpp-5ed27bf5f65f03e14da24a60e261a175074cb7aa.tar.bz2
slixmpp-5ed27bf5f65f03e14da24a60e261a175074cb7aa.tar.xz
slixmpp-5ed27bf5f65f03e14da24a60e261a175074cb7aa.zip
Merge branch 'develop' into roster
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r--sleekxmpp/stanza/iq.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py
index 82ab13ec..4a12a87e 100644
--- a/sleekxmpp/stanza/iq.py
+++ b/sleekxmpp/stanza/iq.py
@@ -154,7 +154,7 @@ class Iq(RootStanza):
StanzaBase.reply(self, clear)
return self
- def send(self, block=True, timeout=None, callback=None):
+ def send(self, block=True, timeout=None, callback=None, now=False):
"""
Send an <iq> stanza over the XML stream.
@@ -178,6 +178,9 @@ class Iq(RootStanza):
Defaults to sleekxmpp.xmlstream.RESPONSE_TIMEOUT
callback -- Optional reference to a stream handler function. Will
be executed when a reply stanza is received.
+ now -- Indicates if the send queue should be skipped and send
+ the stanza immediately. Used during stream
+ initialization. Defaults to False.
"""
if timeout is None:
timeout = self.stream.response_timeout
@@ -188,15 +191,15 @@ class Iq(RootStanza):
callback,
once=True)
self.stream.register_handler(handler)
- StanzaBase.send(self)
+ StanzaBase.send(self, now=now)
return handler_name
elif block and self['type'] in ('get', 'set'):
waitfor = Waiter('IqWait_%s' % self['id'], MatcherId(self['id']))
self.stream.register_handler(waitfor)
- StanzaBase.send(self)
+ StanzaBase.send(self, now=now)
return waitfor.wait(timeout)
else:
- return StanzaBase.send(self)
+ return StanzaBase.send(self, now=now)
def _set_stanza_values(self, values):
"""