From c63e32634a22f3f488dc984885e3d538cbfac9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 23 Dec 2018 22:33:10 +0100 Subject: [PATCH] Adapt Zeroconf to nbxmpp changes Fixes #9503 --- gajim/common/modules/__init__.py | 5 ++++- gajim/common/zeroconf/client_zeroconf.py | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gajim/common/modules/__init__.py b/gajim/common/modules/__init__.py index 89ad22af7..c5aea976d 100644 --- a/gajim/common/modules/__init__.py +++ b/gajim/common/modules/__init__.py @@ -26,7 +26,10 @@ from gajim.common.types import ConnectionT log = logging.getLogger('gajim.c.m') -ZEROCONF_MODULES = ['adhoc_commands', 'receipts', 'discovery'] +ZEROCONF_MODULES = ['adhoc_commands', + 'receipts', + 'discovery', + 'chatstates'] _imported_modules = [] # type: List[tuple] _modules = {} # type: Dict[str, Dict[str, Any]] diff --git a/gajim/common/zeroconf/client_zeroconf.py b/gajim/common/zeroconf/client_zeroconf.py index 95d42708b..b4a005efd 100644 --- a/gajim/common/zeroconf/client_zeroconf.py +++ b/gajim/common/zeroconf/client_zeroconf.py @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License # along with Gajim. If not, see . +from unittest.mock import Mock + from gajim.common import app import nbxmpp from nbxmpp.idlequeue import IdleObject @@ -141,6 +143,7 @@ class P2PClient(IdleObject): self.Namespace = 'jabber:client' self.protocol_type = 'XMPP' self.defaultNamespace = self.Namespace + self.Smacks = Mock() self._component = 0 self._registered_name = None self._caller = conn_holder.caller @@ -190,6 +193,9 @@ class P2PClient(IdleObject): self.on_responses = {} + def get_bound_jid(self): + return self._caller.get_own_jid() + def add_stanza(self, stanza, is_message=False): if self.Connection: if self.Connection.state == -1: