Fix bad reference to function that does not exist and - hopefully - improve subscription handling

This commit is contained in:
Schimon Jehudah 2024-02-07 23:41:02 +00:00
parent 6c16fa4af1
commit c568145ecf
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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')