From c568145ecfbc0f8f3bc37224655ddacb95873921 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Wed, 7 Feb 2024 23:41:02 +0000 Subject: [PATCH] Fix bad reference to function that does not exist and - hopefully - improve subscription handling --- slixfeed/xmpp/client.py | 6 +++--- slixfeed/xmpp/component.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/slixfeed/xmpp/client.py b/slixfeed/xmpp/client.py index ba2a6d5..6f1aabf 100644 --- a/slixfeed/xmpp/client.py +++ b/slixfeed/xmpp/client.py @@ -245,7 +245,7 @@ class Slixfeed(slixmpp.ClientXMPP): jid = message["from"].bare if (await get_chat_type(self, jid) == 'chat' and not self.client_roster[jid]['to']): - XmppPresence.subscribe(self, jid) + XmppPresence.subscription(self, jid, 'subscribe') await XmppRoster.add(self, jid) status_message = '✒️ Share online status to receive updates' XmppPresence.send(self, jid, status_message) @@ -270,7 +270,7 @@ class Slixfeed(slixmpp.ClientXMPP): async def on_presence_subscribe(self, presence): jid = presence['from'].bare if not self.client_roster[jid]['to']: - XmppPresence.subscription(self, jid, 'subscribe') + XmppPresence.subscription(self, jid, 'subscribed') await XmppRoster.add(self, jid) status_message = '✒️ Share online status to receive updates' XmppPresence.send(self, jid, status_message) @@ -309,7 +309,7 @@ class Slixfeed(slixmpp.ClientXMPP): # status_message = '🖋️ Subscribe to receive updates' # status_message = None XmppMessage.send(self, jid, message_body, 'chat') - XmppPresence.subscription(self, jid, 'unsubscribe') + XmppPresence.subscription(self, jid, 'unsubscribed') # XmppPresence.send(self, jid, status_message, # presence_type='unsubscribed') await XmppRoster.remove(self, jid) diff --git a/slixfeed/xmpp/component.py b/slixfeed/xmpp/component.py index 53391db..d57d1ea 100644 --- a/slixfeed/xmpp/component.py +++ b/slixfeed/xmpp/component.py @@ -255,7 +255,7 @@ class SlixfeedComponent(slixmpp.ComponentXMPP): # status_message = '🖋️ Subscribe to receive updates' # status_message = None XmppMessage.send(self, jid, message_body, 'chat') - XmppPresence.subscription(self, jid, 'unsubscribe') + XmppPresence.subscription(self, jid, 'unsubscribed') # XmppPresence.send(self, jid, status_message, # presence_type='unsubscribed')