Commit a8922c32 authored by zimio's avatar zimio

coding standards

parent f94a8cec
......@@ -2003,9 +2003,9 @@ class FileRequestReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
h = file_tag.getTag('hash')
n = file_tag.getTag('name')
if h:
file_info = self.conn.get_files_info(hash_=h)
file_info = self.conn.get_file_info(hash_=h)
elif n:
file_info = self.conn.get_files_info(name=n)
file_info = self.conn.get_file_info(name=n)
self.file_props.file_name = file_info['file-name']
self.file_props.sender = self.conn._ft_get_our_jid()
self.file_props.receiver = self.fjid
......
......@@ -189,12 +189,12 @@ class ConnectionJingle(object):
else:
return sessions
def set_files_info(self, file_):
def set_file_info(self, file_):
# Saves information about the files we have transfered in case they need
# to be requested again.
self.files.append(file_)
def get_files_info(self, hash_=None, name=None):
def get_file_info(self, hash_=None, name=None):
if hash_:
for f in self.files: # DEBUG
#if f['hash'] == '1294809248109223':
......@@ -217,5 +217,5 @@ class ConnectionJingle(object):
for session in self._sessions.values():
if session.peerjid == jid and session.get_content(media):
return session
return None
......@@ -203,7 +203,7 @@ class JingleContent(object):
'date' : self.file_props.date,
'peerjid' : pjid
}
self.session.connection.set_files_info(file_info)
self.session.connection.set_file_info(file_info)
desc = file_tag.setTag('desc')
if self.file_props.desc:
desc.setData(self.file_props.desc)
......
......@@ -142,7 +142,7 @@ class JingleFileTransfer(JingleContent):
'date' : self.file_props.date,
'peerjid' : pjid
}
self.session.connection.set_files_info(file_info)
self.session.connection.set_file_info(file_info)
def _calcHash(self):
# Caculates the hash and returns a xep-300 hash stanza
......
......@@ -522,9 +522,9 @@ class JingleSession(object):
h = request.getTag('file').getTag('hash')
n = request.getTag('file').getTag('name')
if h:
file_info = self.connection.get_files_info(hash_=h)
file_info = self.connection.get_file_info(hash_=h)
elif n:
file_info = self.connection.get_files_info(name=n)
file_info = self.connection.get_file_info(name=n)
pjid = gajim.get_jid_without_resource(self.peerjid)
if not file_info or file_info['peerjid'] != pjid:
log.warning('The peer ' + pjid + \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment