From 7c79f285871da9ee2b7b4ce56e83a0d68911da6c Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 22 Mar 2024 20:48:36 +0100 Subject: [PATCH] XEP-0199: handle component case for keepalive ping --- slixmpp/plugins/xep_0199/ping.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/slixmpp/plugins/xep_0199/ping.py b/slixmpp/plugins/xep_0199/ping.py index 03d272dd..dc070c96 100644 --- a/slixmpp/plugins/xep_0199/ping.py +++ b/slixmpp/plugins/xep_0199/ping.py @@ -137,7 +137,14 @@ class XEP_0199(BasePlugin): async def _keepalive(self, event=None): log.debug("Keepalive ping...") try: - rtt = await self.ping(self.xmpp.boundjid.host, timeout=self.timeout) + ifrom = None + if self.xmpp.is_component: + ifrom = self.xmpp.boundjid + rtt = await self.ping( + self.xmpp.boundjid.host, + timeout=self.timeout, + ifrom=ifrom + ) except IqTimeout: log.debug("Did not receive ping back in time. " + \ "Requesting Reconnect.")