Slixfeed/slixfeed/xmpp/presence.py

33 lines
861 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
NOTE
Accept symbols 🉑 👍
TODO
2024-03-03 15:13:01 +01:00
Remove subscription from JID that do not (i.e. has stopped) share presence.
"""
class XmppPresence:
def send(self, jid, status_message, presence_type=None, status_type=None):
jid_from = str(self.boundjid) if self.is_component else None
self.send_presence(pto=jid,
pfrom=jid_from,
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)