component file sharing: added missing owner filtering in _retrieveFiles

This commit is contained in:
Goffi 2020-09-20 14:04:22 +02:00
commit f7a83dd054

View file

@ -54,6 +54,7 @@ PLUGIN_INFO = {
C.PI_DEPENDENCIES: [
"FILE",
"FILE_SHARING_MANAGEMENT",
"XEP-0106",
"XEP-0234",
"XEP-0260",
"XEP-0261",
@ -518,6 +519,7 @@ class FileSharing:
):
"""This method retrieve a file on request, and send if after checking permissions"""
peer_jid = session["peer_jid"]
owner = client.getOwnerFromJid(session['local_jid'])
try:
found_files = yield self.host.memory.getFiles(
client,
@ -527,6 +529,7 @@ class FileSharing:
hash_algo=file_data.get("hash_algo"),
path=file_data.get("path"),
namespace=file_data.get("namespace"),
owner=owner,
)
except exceptions.NotFound:
found_files = None