comparison src/plugins/plugin_xep_0234.py @ 1753:27a140aa5023

plugin XEP-0234: log file transfer "terminated" instead of "completed", as the file may not be complete (check is done after)
author Goffi <goffi@goffi.org>
date Thu, 17 Dec 2015 22:02:52 +0100
parents 697effba0310
children d17772b0fe22
comparison
equal deleted inserted replaced
1752:cbcc223c323a 1753:27a140aa5023
304 except (KeyError, internet_error.AlreadyCalled): 304 except (KeyError, internet_error.AlreadyCalled):
305 pass 305 pass
306 return True 306 return True
307 307
308 def _finishedCb(self, dummy, session, content_name, content_data, profile): 308 def _finishedCb(self, dummy, session, content_name, content_data, profile):
309 log.info(u"File transfer completed") 309 log.info(u"File transfer terminated")
310 if content_data['senders'] != session['role']: 310 if content_data['senders'] != session['role']:
311 # we terminate the session only if we are the receiver, 311 # we terminate the session only if we are the receiver,
312 # as recommanded in XEP-0234 §2 (after example 6) 312 # as recommanded in XEP-0234 §2 (after example 6)
313 content_data['transfer_finished'] = True 313 content_data['transfer_finished'] = True
314 if not self._receiverTryTerminate(session, content_name, content_data, profile=profile): 314 if not self._receiverTryTerminate(session, content_name, content_data, profile=profile):