add initiator to every jingle stanza

This commit is contained in:
Jefry Lagrange 2011-07-27 22:01:49 -04:00
parent d5ffbf8834
commit af9d304c52
1 changed files with 3 additions and 4 deletions

View File

@ -630,10 +630,9 @@ class JingleSession(object):
stanza = xmpp.Iq(typ='set', to=xmpp.JID(self.peerjid), stanza = xmpp.Iq(typ='set', to=xmpp.JID(self.peerjid),
frm=self.ourjid) frm=self.ourjid)
attrs = {'action': action, attrs = {'action': action,
'sid': self.sid} 'sid': self.sid,
if action == 'session-initiate' or action == 'session-accept' or \ 'initiator' : self.initiator}
action == 'transport-replace' or action == 'transport-info':
attrs['initiator'] = self.initiator
jingle = stanza.addChild('jingle', attrs=attrs, namespace=xmpp.NS_JINGLE) jingle = stanza.addChild('jingle', attrs=attrs, namespace=xmpp.NS_JINGLE)
if reason is not None: if reason is not None:
jingle.addChild(node=reason) jingle.addChild(node=reason)