Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
196
Issues
196
List
Boards
Labels
Service Desk
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
fbd65d79
Commit
fbd65d79
authored
May 16, 2020
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client: Don't create nbxmpp.Client() after cleanup()
parent
dce40846
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
gajim/common/client.py
gajim/common/client.py
+13
-0
No files found.
gajim/common/client.py
View file @
fbd65d79
...
...
@@ -77,6 +77,8 @@ def __init__(self, account):
self
.
_ssl_errors
=
set
()
self
.
_destroyed
=
False
self
.
available_transports
=
{}
modules
.
register_modules
(
self
)
...
...
@@ -120,6 +122,16 @@ def set_remove_account(self, value):
self
.
_remove_account
=
value
def
_create_client
(
self
):
if
self
.
_destroyed
:
# If we disable an account cleanup() is called and all
# modules are unregistered. Because disable_account() does not wait
# for the client to properly disconnect, handlers of the
# nbxmpp.Client() are emitted after we called cleanup().
# After nbxmpp.Client() disconnects and is destroyed we create a
# new instance with this method but modules.get_handlers() fails
# because modules are already unregistered.
# TODO: Make this nicer
return
log
.
info
(
'Create new nbxmpp client'
)
self
.
_client
=
NBXMPPClient
(
log_context
=
self
.
_account
)
self
.
connection
=
self
.
_client
...
...
@@ -518,6 +530,7 @@ def _disable_reconnect_timer(self):
self
.
_reconnect_timer_source
=
None
def
cleanup
(
self
):
self
.
_destroyed
=
True
modules
.
unregister_modules
(
self
)
def
quit
(
self
,
kill_core
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment