plugin attach, XEP-0363: progress id can now be specified:

progress id can be specified in options, using the "progress_id" option, this can be
more handy for frontends to keep track of attachments progresses.
This commit is contained in:
Goffi 2020-02-23 17:48:26 +01:00
commit c5915d1dcb

View file

@ -75,6 +75,9 @@ class AttachPlugin:
name = attachment["name"] = path.name
options = {}
progress_id = attachment.get("progress_id")
if progress_id:
options["progress_id"] = attachment["progress_id"]
if client.encryption.isEncryptionRequested(data):
# FIXME: we should not use implementation specific value here
# but for not it's the only file encryption method available with
@ -85,6 +88,7 @@ class AttachPlugin:
client,
filepath=path,
filename=name,
options=options,
)
uploads_d.append(upload_d)