diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index f790c1620..16f5d3418 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -1996,8 +1996,13 @@ class FileRequestReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): desc = self.jingle_content.getTag('description') if desc.getTag('offer'): file_tag = desc.getTag('offer').getTag('file') + self.file_props.sender = self.fjid + self.file_props.receiver = self.conn._ft_get_our_jid() else: file_tag = desc.getTag('request').getTag('file') + self.file_props.sender = self.conn._ft_get_our_jid() + self.file_props.receiver = self.fjid + self.file_props.type_ = 's' for child in file_tag.getChildren(): name = child.getName() val = child.getData() @@ -2050,12 +2055,12 @@ class FileRequestReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): mime_type = si.getAttr('mime-type') if mime_type is not None: self.file_props.mime_type = mime_type - self.file_props.sender = self.fjid + self.file_props.sender = self.fjid + self.file_props.receiver = self.conn._ft_get_our_jid() self.file_props.request_id = self.id_ file_desc_tag = file_tag.getTag('desc') if file_desc_tag is not None: self.file_props.desc = file_desc_tag.getData() - self.file_props.receiver = self.conn._ft_get_our_jid() self.file_props.transfered_size = [] return True diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py index 418a6ec47..b2f3171f3 100644 --- a/src/common/jingle_content.py +++ b/src/common/jingle_content.py @@ -195,6 +195,7 @@ class JingleContent(object): h = self._calcHash() file_tag.addChild(node=h) file_info = {'name' : self.file_props.name, + 'file-name' : self.file_props.file_name, 'hash' : self.file_props.hash_, 'size' : self.file_props.size, 'date' : self.file_props.date diff --git a/src/common/jingle_ft.py b/src/common/jingle_ft.py index db9197f64..851a16289 100644 --- a/src/common/jingle_ft.py +++ b/src/common/jingle_ft.py @@ -128,6 +128,7 @@ class JingleFileTransfer(JingleContent): checksum.setNamespace(xmpp.NS_JINGLE_FILE_TRANSFER) self.session.__session_info(checksum ) file_info = {'name' : self.file_props.name, + 'file-name' : self.file_props.file_name, 'hash' : self.file_props.hash_, 'size' : self.file_props.size, 'date' : self.file_props.date diff --git a/src/common/jingle_session.py b/src/common/jingle_session.py index 68c0ee313..44cab74ed 100644 --- a/src/common/jingle_session.py +++ b/src/common/jingle_session.py @@ -522,8 +522,11 @@ class JingleSession(object): file_info = self.connection.get_files_info(hash_=h) elif n: file_info = self.connection.get_files_info(name=n) - if not file_info: - # Send 404 error? + if file_info: + file_props = FilesProp.getFileProp(self.connection.name, + self.sid) + file_props.file_name = file_info['file-name'] + else: log.warning('The peer ' + self.peerjid + \ ' is requesting a ' + \ 'file that we dont have') diff --git a/src/common/protocol/bytestream.py b/src/common/protocol/bytestream.py index 0b3300e37..c87e210ea 100644 --- a/src/common/protocol/bytestream.py +++ b/src/common/protocol/bytestream.py @@ -32,7 +32,6 @@ import socket import base64 import gobject import time -import pdb from common import xmpp from common import gajim @@ -838,7 +837,6 @@ class ConnectionIBBytestream(ConnectionBytestream): Send next portion of data if it is time to do it. Used internally. """ log.debug('SendHandler called') - #pdb.set_trace() for file_props in FilesProp.getAllFileProp(): if not file_props.direction: # it's socks5 bytestream