plugin XEP-0234: "senders" handling
This commit is contained in:
parent
170d697016
commit
a24031596a
1 changed files with 4 additions and 0 deletions
|
|
@ -74,6 +74,7 @@ class XEP_0234(object):
|
|||
def fileJingleSend(self, to_jid, filepath, name=None, file_desc=None, profile=C.PROF_KEY_NONE):
|
||||
self._j.initiate(to_jid,
|
||||
[{'app_ns': NS_JINGLE_FT,
|
||||
'senders': self._j.ROLE_INITIATOR,
|
||||
'app_kwargs': {'filepath': filepath,
|
||||
'name': name,
|
||||
'file_desc': file_desc},
|
||||
|
|
@ -165,6 +166,9 @@ class XEP_0234(object):
|
|||
def jingleRequestConfirmation(self, action, session, content_name, desc_elt, profile):
|
||||
"""This method request confirmation for a jingle session"""
|
||||
content_data = session['contents'][content_name]
|
||||
if content_data['senders'] not in (self._j.ROLE_INITIATOR, self._j.ROLE_RESPONDER):
|
||||
log.warning(u"Bad sender, assuming initiator")
|
||||
content_data['senders'] = self._j.ROLE_INITIATOR
|
||||
# first we grab file informations
|
||||
try:
|
||||
file_elt = desc_elt.elements(NS_JINGLE_FT, 'file').next()
|
||||
|
|
|
|||
Loading…
Reference in a new issue