Slixfeed/slixfeed/xmpp/presence.py
Schimon Jehudah 6c16fa4af1 Restore support for disabling and enabling feeds.
Assign handlers to "self".
Towards better handling of subscription and unsubscription.
Minor fixes.
2024-02-07 22:24:59 +00:00

31 lines
793 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
NOTE
Accept symbols 🉑️ 👍️ ✍
TODO
Remove subscription from JID that do not (stopped) share presence.
"""
class XmppPresence:
def send(self, jid, status_message, presence_type=None, status_type=None):
self.send_presence(pto=jid,
pfrom=self.boundjid.bare,
pshow=status_type,
pstatus=status_message,
ptype=presence_type)
def subscription(self, jid, presence_type):
self.send_presence_subscription(pto=jid,
pfrom=self.boundjid.bare,
ptype=presence_type,
pnick=self.alias)