# HG changeset patch # User Goffi # Date 1553494269 -3600 # Node ID c73a7cd36b54c5a14da250a88dbebeacc0f88060 # Parent 1b835bcfa6635bf6ab9d73a397381eec686110b7 chat: show warning note on failing fileUpload + added forgotten "profile" argument diff -r 1b835bcfa663 -r c73a7cd36b54 cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Mon Mar 25 07:11:09 2019 +0100 +++ b/cagou/plugins/plugin_wid_chat.py Mon Mar 25 07:11:09 2019 +0100 @@ -598,8 +598,11 @@ def fileTransferEb(self, err_msg, cleaning_cb, profile): if cleaning_cb is not None: cleaning_cb() - # TODO: display message to user - log.warning(u"Can't transfer file: {}".format(err_msg)) + msg = _(u"can't transfer file: {reason}").format(reason=err_msg) + log.warning(msg) + self.addNote(_(u"File transfer error"), + msg, + level=C.XMLUI_DATA_LVL_WARNING) def fileTransferCb(self, metadata, cleaning_cb, profile): log.debug("file transfered: {}".format(metadata)) @@ -623,6 +626,7 @@ def onTransferOK(self, file_path, cleaning_cb, transfer_type): if transfer_type == C.TRANSFER_UPLOAD: + G.host.bridge.fileUpload( file_path, "", @@ -633,7 +637,10 @@ G.host.actionManager, progress_cb = partial(self.fileTransferCb, cleaning_cb=cleaning_cb), progress_eb = partial(self.fileTransferEb, cleaning_cb=cleaning_cb), - ) + profile = self.profile, + ), + errback = partial(G.host.errback, + message=_(u"can't upload file: {msg}")) ) elif transfer_type == C.TRANSFER_SEND: if self.type == C.CHAT_GROUP: