Skip to content
Snippets Groups Projects
Commit fdfb0864 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

PluginManager: Remove obsolete check on handler registration

parent fbd65d79
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,6 @@ def __init__(self, account):
self.password = None
self._priority = 0
self.handlers_registered = False
self._connect_machine_calls = 0
self.avatar_conversion = False
self.addressing_supported = False
......@@ -175,7 +174,6 @@ def _create_client(self):
for handler in modules.get_handlers(self):
self._client.register_handler(handler)
self.handlers_registered = True
def process_ssl_errors(self):
if not self._ssl_errors:
......
......@@ -406,13 +406,8 @@ def _register_modules_with_handlers(self, plugin):
instance, name = module.get_instance(con)
modules.register_single_module(con, instance, name)
# If handlers have been registered, register the
# plugin handlers. Otherwise this will be done
# automatically on connecting
# in connection_handlers._register_handlers()
if con.handlers_registered:
for handler in instance.handlers:
con.connection.register_handler(handler)
for handler in instance.handlers:
con.connection.register_handler(handler)
def _unregister_modules_with_handlers(self, plugin):
if not hasattr(plugin, 'modules'):
......@@ -422,11 +417,8 @@ def _unregister_modules_with_handlers(self, plugin):
instance = con.get_module(module.name)
modules.unregister_single_module(con, module.name)
# Account is still connected and handlers are registered
# So just unregister the plugin handlers
if con.handlers_registered:
for handler in instance.handlers:
con.connection.unregister_handler(handler)
for handler in instance.handlers:
con.connection.unregister_handler(handler)
def activate_plugin(self, plugin):
'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment