plugin upload, XEP-0363: code modernisation + preparation for extension:

- use of async/await syntax
- fileUpload's options are now serialised, allowing non string values
- (XEP-0363) Slot is now a dataclass, so it can be modified by other plugins
- (XEP-0363) Moved SSL related code to the new tools.web module
- (XEP-0363) added `XEP-0363_upload_size` and `XEP-0363_upload` trigger points
- a Deferred is not used anymore for `progress_id`, the value is directly returned
This commit is contained in:
Goffi 2019-12-20 12:28:04 +01:00
commit edbee4d719

View file

@ -478,7 +478,7 @@ class Upload(base.CommandBase):
options = {}
if self.args.ignore_tls_errors:
options["ignore_tls_errors"] = C.BOOL_TRUE
options["ignore_tls_errors"] = True
path = os.path.abspath(file_)
try:
@ -486,7 +486,7 @@ class Upload(base.CommandBase):
path,
"",
self.full_dest_jid,
options,
data_format.serialise(options),
self.profile,
)
except Exception as e: