Commit 1256372d authored by Philipp Hörist's avatar Philipp Hörist

Handle nbxmpp error results

parent 5059f723
Pipeline #3038 passed with stages
in 3 minutes and 24 seconds
......@@ -17,6 +17,7 @@
import logging
import nbxmpp
from nbxmpp.util import is_error_result
from gajim.common import app
from gajim.common.nec import NetworkEvent
......@@ -62,8 +63,8 @@ class Blocking(BaseModule):
log.info('Discovered blocking: %s', from_)
def _blocking_list_received(self, result):
if result.is_error:
log.info('Error: %s', result.error)
if is_error_result(result):
log.info('Error: %s', result)
return
self.blocked = result.blocking_list
......
......@@ -22,6 +22,7 @@ import logging
import copy
import nbxmpp
from nbxmpp.util import is_error_result
from nbxmpp.structs import BookmarkData
from nbxmpp.const import BookmarkStoreType
from gi.repository import GLib
......@@ -161,6 +162,10 @@ class Bookmarks(BaseModule):
type_, callback=self._bookmarks_received)
def _bookmarks_received(self, bookmarks):
if is_error_result(bookmarks):
log.info('Error: %s', bookmarks)
bookmarks = []
self._request_in_progress = False
self._bookmarks = bookmarks
self.auto_join_bookmarks()
......
......@@ -17,6 +17,7 @@
import logging
import nbxmpp
from nbxmpp.util import is_error_result
from gajim.common import app
from gajim.common.modules.base import BaseModule
......@@ -65,6 +66,10 @@ class UserAvatar(BaseModule):
jid, data.id, callback=self._avatar_received)
def _avatar_received(self, result):
if is_error_result(result):
log.info('Error: %s', result)
return
log.info('Received Avatar: %s %s', result.jid, result.sha)
app.interface.save_avatar(result.data)
......
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