Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
l-n-s
gajim
Commits
1256372d
Commit
1256372d
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Handle nbxmpp error results
parent
5059f723
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gajim/common/modules/blocking.py
+3
-2
3 additions, 2 deletions
gajim/common/modules/blocking.py
gajim/common/modules/bookmarks.py
+5
-0
5 additions, 0 deletions
gajim/common/modules/bookmarks.py
gajim/common/modules/user_avatar.py
+5
-0
5 additions, 0 deletions
gajim/common/modules/user_avatar.py
with
13 additions
and
2 deletions
gajim/common/modules/blocking.py
+
3
−
2
View file @
1256372d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
gajim/common/modules/bookmarks.py
+
5
−
0
View file @
1256372d
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
gajim/common/modules/user_avatar.py
+
5
−
0
View file @
1256372d
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment