comparison sat/plugins/plugin_comp_file_sharing.py @ 3514:6d9c9e2dca0a

component (file sharing): fix retrieving owner from jid when user part is not specified
author Goffi <goffi@goffi.org>
date Sat, 01 May 2021 18:22:53 +0200
parents 375449da79f6
children 849374e59178
comparison
equal deleted inserted replaced
3513:753d151da886 3514:6d9c9e2dca0a
517 def _retrieveFiles( 517 def _retrieveFiles(
518 self, client, session, content_data, content_name, file_data, file_elt 518 self, client, session, content_data, content_name, file_data, file_elt
519 ): 519 ):
520 """This method retrieve a file on request, and send if after checking permissions""" 520 """This method retrieve a file on request, and send if after checking permissions"""
521 peer_jid = session["peer_jid"] 521 peer_jid = session["peer_jid"]
522 owner = client.getOwnerFromJid(session['local_jid']) 522 if session['local_jid'].user:
523 owner = client.getOwnerFromJid(session['local_jid'])
524 else:
525 owner = peer_jid
523 try: 526 try:
524 found_files = yield self.host.memory.getFiles( 527 found_files = yield self.host.memory.getFiles(
525 client, 528 client,
526 peer_jid=peer_jid, 529 peer_jid=peer_jid,
527 name=file_data.get("name"), 530 name=file_data.get("name"),