comparison sat/plugins/plugin_xep_0363.py @ 3182:f2bb57348587

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.
author Goffi <goffi@goffi.org>
date Sun, 23 Feb 2020 17:48:26 +0100
parents 3a8755fdc78d
children 883fb4981958
comparison
equal deleted inserted replaced
3181:5ff2cf7f0aba 3182:f2bb57348587
158 log.warning(_("Can't get upload slot: {reason}").format(reason=e)) 158 log.warning(_("Can't get upload slot: {reason}").format(reason=e))
159 raise e 159 raise e
160 else: 160 else:
161 log.debug(f"Got upload slot: {slot}") 161 log.debug(f"Got upload slot: {slot}")
162 sat_file = self.host.plugins["FILE"].File( 162 sat_file = self.host.plugins["FILE"].File(
163 self.host, client, filepath, size=size, auto_end_signals=False 163 self.host, client, filepath, uid=options.get("progress_id"), size=size,
164 auto_end_signals=False
164 ) 165 )
165 progress_id = sat_file.uid 166 progress_id = sat_file.uid
166 167
167 file_producer = http_client.FileBodyProducer(sat_file) 168 file_producer = http_client.FileBodyProducer(sat_file)
168 169