comparison src/plugins/plugin_xep_0096.py @ 995:4dbe8e57ff51

plugin XEP-0096: fixed a bug introduced by the log refactoring
author Goffi <goffi@goffi.org>
date Sun, 20 Apr 2014 11:51:48 +0200
parents 301b342c697a
children 9a85836f0d45
comparison
equal deleted inserted replaced
994:652c01ca69b1 995:4dbe8e57ff51
274 return "" 274 return ""
275 feature_elt = self.host.plugins["XEP-0020"].proposeFeatures({'stream-method': self.managed_stream_m}) 275 feature_elt = self.host.plugins["XEP-0020"].proposeFeatures({'stream-method': self.managed_stream_m})
276 276
277 file_transfer_elts = [] 277 file_transfer_elts = []
278 278
279 statlog.info = os.stat(filepath) 279 statinfo = os.stat(filepath)
280 file_elt = domish.Element((PROFILE, 'file')) 280 file_elt = domish.Element((PROFILE, 'file'))
281 file_elt['name'] = os.path.basename(filepath) 281 file_elt['name'] = os.path.basename(filepath)
282 size = file_elt['size'] = str(statlog.info.st_size) 282 size = file_elt['size'] = str(statinfo.st_size)
283 file_transfer_elts.append(file_elt) 283 file_transfer_elts.append(file_elt)
284 284
285 file_transfer_elts.append(domish.Element((None, 'range'))) 285 file_transfer_elts.append(domish.Element((None, 'range')))
286 286
287 sid, offer = self.host.plugins["XEP-0095"].proposeStream(jid.JID(to_jid), PROFILE, feature_elt, file_transfer_elts, profile_key=profile) 287 sid, offer = self.host.plugins["XEP-0095"].proposeStream(jid.JID(to_jid), PROFILE, feature_elt, file_transfer_elts, profile_key=profile)