summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/stanzabase.py
diff options
context:
space:
mode:
authorLance Stout <lance@dingus.local>2011-05-27 16:59:52 -0700
committerLance Stout <lance@dingus.local>2011-05-27 17:00:57 -0700
commit1735c194cdf83b61850bba45044070db6c42d0ac (patch)
tree56508a2c0955f8ca1d04e17c54e066080b43b961 /sleekxmpp/xmlstream/stanzabase.py
parent6997b2fbf87a080a12334b348653ed4cb30f9218 (diff)
downloadslixmpp-1735c194cdf83b61850bba45044070db6c42d0ac.tar.gz
slixmpp-1735c194cdf83b61850bba45044070db6c42d0ac.tar.bz2
slixmpp-1735c194cdf83b61850bba45044070db6c42d0ac.tar.xz
slixmpp-1735c194cdf83b61850bba45044070db6c42d0ac.zip
Don't use the send queue for stream initialization.
Use the parameter now=True to skip the queue when sending Iq stanzas, or using xmpp.send().
Diffstat (limited to 'sleekxmpp/xmlstream/stanzabase.py')
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index b8a7ceaa..d9a4636a 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -1253,9 +1253,15 @@ class StanzaBase(ElementBase):
log.exception('Error handling {%s}%s stanza' % (self.namespace,
self.name))
- def send(self):
- """Queue the stanza to be sent on the XML stream."""
- self.stream.sendRaw(self.__str__())
+ def send(self, now=False):
+ """
+ Queue the stanza to be sent on the XML stream.
+ Arguments:
+ now -- Indicates if the queue should be skipped and the
+ stanza sent immediately. Useful for stream
+ initialization. Defaults to False.
+ """
+ self.stream.send_raw(self.__str__(), now=now)
def __copy__(self):
"""