send now has a priority and an 'init' parameter to denote stanzas that may be sent prior to session establishment.

This commit is contained in:
Tom Nichols
2010-07-06 14:16:46 -04:00
parent 0a30e6c017
commit 259dffeb6e
5 changed files with 35 additions and 30 deletions

View File

@@ -67,11 +67,11 @@ class Iq(RootStanza):
self.xml.remove(child)
return self
def send(self, block=True, timeout=10, priority=False):
def send(self, block=True, timeout=10, priority=5, init=False):
if block and self['type'] in ('get', 'set'):
waitfor = Waiter('IqWait_%s' % self['id'], MatcherId(self['id']))
self.stream.registerHandler(waitfor)
StanzaBase.send(self, priority)
StanzaBase.send(self, priority, init)
return waitfor.wait(timeout)
else:
return StanzaBase.send(self, priority)
return StanzaBase.send(self, priority, init)