Commit graph libervia-backend/sat/plugins/plugin_misc_attach.py
Author SHA1 Message Date
Goffi
8d64157d88 core: fix calls to domish.Element.elements:
domish.Element.elements should be called with namespace and element name as 2 arguments,
but it has been confused in several places with the call to `domish.Element.addElement`
which is often done with a `(namespace, name)` tuple. Unfortunately calling with a tuple
is accepted and doesn't raise any error in `elements`, but this result in a wrong element
returned.

This patch fixes the erroneous calls.
2022-07-20 17:12:29 +02:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
ddf8cf6ea7 plugin attach: handle large images resizing:
if `C.MESS_KEY_ATTACHMENTS_RESIZE` flag is set for an attachment, it will be checked, and
if it is a large image, a resized copy will be uploaded.
2020-03-22 14:04:16 +01:00
Goffi
06516eeb1d plugin attach, aesgcm: attachments refactoring:
attachment handling has been simplified, and now use a "register" method similar as the
ones used for download or upload.
A default method (for unencrypted messages) will try a simple upload and will copy the
links to body.

AESGCM plugin has been adapted to be used for encrypted files. If more than one file is
sent with AESGCM plugin, they will be split in several messages as current de-facto
standard (OMEMO media sharing) doesn't support several files per message.
2020-03-18 20:25:02 +01:00
Goffi
4c474efb3d plugin attachment: remove "path" from attachment once used:
"path" refers to a local path of a file, we don't want to store it in database as the file
may be in a temporary location, or even be a temporary file. So once the file has been
uploaded, we remove it.
2020-03-06 18:19:03 +01:00
Goffi
5a9886d390 plugin attach: disable TLS check if "check_certificate" is disabled 2020-02-28 10:06:23 +01:00
Goffi
c5915d1dcb 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.
2020-02-23 17:48:26 +01:00
Goffi
3b730721eb plugin attach: first draft:
this plugin handles the uploading of files attached in message data.
2020-02-23 17:48:26 +01:00