comparison cagou/plugins/plugin_wid_chat.py @ 333:69d2a96ce26f

chat: serialise `options` in `fileUpload` following change in backend
author Goffi <goffi@goffi.org>
date Fri, 20 Dec 2019 12:29:37 +0100
parents 13bc00b9743a
children 36d6763af547
comparison
equal deleted inserted replaced
332:13bc00b9743a 333:69d2a96ce26f
28 from kivy.uix.dropdown import DropDown 28 from kivy.uix.dropdown import DropDown
29 from kivy.core.window import Window 29 from kivy.core.window import Window
30 from sat.core import log as logging 30 from sat.core import log as logging
31 from sat.core.i18n import _ 31 from sat.core.i18n import _
32 from sat.core import exceptions 32 from sat.core import exceptions
33 from sat.tools.common import data_format
33 from sat_frontends.quick_frontend import quick_widgets 34 from sat_frontends.quick_frontend import quick_widgets
34 from sat_frontends.quick_frontend import quick_chat 35 from sat_frontends.quick_frontend import quick_chat
35 from sat_frontends.tools import jid 36 from sat_frontends.tools import jid
36 from cagou import G 37 from cagou import G
37 from cagou.core.constants import Const as C 38 from cagou.core.constants import Const as C
686 cleaning_cb() 687 cleaning_cb()
687 688
688 689
689 def transferFile(self, file_path, transfer_type=C.TRANSFER_UPLOAD, cleaning_cb=None): 690 def transferFile(self, file_path, transfer_type=C.TRANSFER_UPLOAD, cleaning_cb=None):
690 if transfer_type == C.TRANSFER_UPLOAD: 691 if transfer_type == C.TRANSFER_UPLOAD:
692 options = {
693 "ignore_tls_errors": not G.host.tls_validation,
694 }
691 G.host.bridge.fileUpload( 695 G.host.bridge.fileUpload(
692 str(file_path), 696 str(file_path),
693 "", 697 "",
694 "", 698 "",
695 {"ignore_tls_errors": C.boolConst(not G.host.tls_validation)}, 699 data_format.serialise(options),
696 self.profile, 700 self.profile,
697 callback = partial( 701 callback = partial(
698 G.host.actionManager, 702 G.host.actionManager,
699 progress_cb = partial(self.fileTransferCb, cleaning_cb=cleaning_cb), 703 progress_cb = partial(self.fileTransferCb, cleaning_cb=cleaning_cb),
700 progress_eb = partial(self.fileTransferEb, cleaning_cb=cleaning_cb), 704 progress_eb = partial(self.fileTransferEb, cleaning_cb=cleaning_cb),