changeset 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 753d151da886
children 2dce411c2647
files sat/plugins/plugin_comp_file_sharing.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing.py	Thu Apr 29 15:49:59 2021 +0200
+++ b/sat/plugins/plugin_comp_file_sharing.py	Sat May 01 18:22:53 2021 +0200
@@ -519,7 +519,10 @@
     ):
         """This method retrieve a file on request, and send if after checking permissions"""
         peer_jid = session["peer_jid"]
-        owner = client.getOwnerFromJid(session['local_jid'])
+        if session['local_jid'].user:
+            owner = client.getOwnerFromJid(session['local_jid'])
+        else:
+            owner = peer_jid
         try:
             found_files = yield self.host.memory.getFiles(
                 client,