Commit 8b3eb6d6 authored by Philipp Hörist's avatar Philipp Hörist

IBB: Adapt to nbxmpp changes

parent 7ac4ba3b
Pipeline #6641 passed with stages
in 2 minutes and 57 seconds
......@@ -20,7 +20,7 @@
from nbxmpp.namespaces import Namespace
from nbxmpp.protocol import NodeProcessed
from nbxmpp.structs import StanzaHandler
from nbxmpp.util import is_error_result
from nbxmpp.errors import StanzaError
from gajim.common import app
from gajim.common.helpers import to_user_string
......@@ -149,11 +149,15 @@ def send_open(self, to, sid, fp):
user_data=file_props)
return file_props
def _on_open_result(self, result, file_props):
if is_error_result(result):
app.socks5queue.error_cb('Error', to_user_string(result))
self._log.warning(result)
def _on_open_result(self, task):
try:
task.finish()
except StanzaError as error:
app.socks5queue.error_cb('Error', to_user_string(error))
self._log.warning(error)
return
file_props = task.get_user_data()
self.send_data(file_props)
def send_close(self, file_props):
......@@ -183,10 +187,12 @@ def send_close(self, file_props):
if session.weinitiate:
session.cancel_session()
def _on_close_result(self, result):
if is_error_result(result):
app.socks5queue.error_cb('Error', to_user_string(result))
self._log.warning(result)
def _on_close_result(self, task):
try:
task.finish()
except StanzaError as error:
app.socks5queue.error_cb('Error', to_user_string(error))
self._log.warning(error)
return
def send_data(self, file_props):
......@@ -217,11 +223,15 @@ def send_data(self, file_props):
file_props.completed = True
app.socks5queue.progress_transfer_cb(self._account, file_props)
def _on_data_result(self, result, file_props):
if is_error_result(result):
app.socks5queue.error_cb('Error', to_user_string(result))
self._log.warning(result)
def _on_data_result(self, task):
try:
task.finish()
except StanzaError as error:
app.socks5queue.error_cb('Error', to_user_string(error))
self._log.warning(error)
return
file_props = task.get_user_data()
self.send_data(file_props)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment