From a02cc5a7a4e538c46eaba2845f22a0755dd9506b Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Tue, 19 Nov 2024 11:11:49 +0200 Subject: [PATCH] Check self presence upon an invitation to a group chat. --- kaikout/xmpp/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kaikout/xmpp/client.py b/kaikout/xmpp/client.py index e64fb7c..be9f93f 100644 --- a/kaikout/xmpp/client.py +++ b/kaikout/xmpp/client.py @@ -148,6 +148,9 @@ class XmppClient(slixmpp.ClientXMPP): .format(self.alias, self.boundjid.bare)) XmppMessage.send(self, room, message_body, 'groupchat') XmppStatus.send_status_message(self, room) + self.add_event_handler("muc::%s::got_online" % room, self.on_muc_got_online) + self.add_event_handler("muc::%s::presence" % room, self.on_muc_presence) + self.add_event_handler("muc::%s::self-presence" % room, self.on_muc_self_presence) async def on_groupchat_direct_invite(self, message): @@ -164,6 +167,9 @@ class XmppClient(slixmpp.ClientXMPP): .format(self.boundjid.bare)) XmppMessage.send(self, room, message_body, 'groupchat') XmppStatus.send_status_message(self, room) + self.add_event_handler("muc::%s::got_online" % room, self.on_muc_got_online) + self.add_event_handler("muc::%s::presence" % room, self.on_muc_presence) + self.add_event_handler("muc::%s::self-presence" % room, self.on_muc_self_presence) async def on_message(self, message):