Commit 42ccbe74 authored by Philipp Hörist's avatar Philipp Hörist

Dont fail if modules are not registered

This is for Zeroconf so we dont have to test in GUI always for
account != local

Fixes #9229
parent a4350a81
......@@ -63,6 +63,7 @@ from gajim.common import gpg
from gajim.common import passwords
from gajim.common import i18n
from gajim.common import idle
from gajim.common.helpers import ModuleMock
from gajim.common.modules.entity_time import EntityTime
from gajim.common.modules.software_version import SoftwareVersion
from gajim.common.modules.ping import Ping
......@@ -179,7 +180,10 @@ class CommonConnection:
app.ged.raise_event(event, self.name, data)
def get_module(self, name):
return self._modules[name]
try:
return self._modules[name]
except KeyError:
return ModuleMock()
def get_module_handlers(self):
handlers = []
......
......@@ -164,6 +164,14 @@ class LocalTimezone(tzinfo):
class InvalidFormat(Exception):
pass
class ModuleMock:
def __getattr__(self, key):
def _mock(self, *args, **kwargs):
return
return _mock
def decompose_jid(jidstring):
user = None
server = None
......
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