core (xmpp): renamed SatRosterProtocol.presenceSubscribed to isSubscribedFrom (and added isSubscribedTo)
This commit is contained in:
parent
bab851006f
commit
fcbbc2aeed
1 changed files with 10 additions and 2 deletions
|
|
@ -1552,7 +1552,7 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
|
|||
f"a JID is expected, not {type(entity_jid)}: {entity_jid!r}")
|
||||
return entity_jid in self._jids
|
||||
|
||||
def isPresenceAuthorised(self, entity_jid):
|
||||
def isSubscribedFrom(self, entity_jid: jid.JID) -> bool:
|
||||
"""Return True if entity is authorised to see our presence"""
|
||||
try:
|
||||
item = self._jids[entity_jid.userhostJID()]
|
||||
|
|
@ -1560,6 +1560,14 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
|
|||
return False
|
||||
return item.subscriptionFrom
|
||||
|
||||
def isSubscribedTo(self, entity_jid: jid.JID) -> bool:
|
||||
"""Return True if we are subscribed to entity"""
|
||||
try:
|
||||
item = self._jids[entity_jid.userhostJID()]
|
||||
except KeyError:
|
||||
return False
|
||||
return item.subscriptionTo
|
||||
|
||||
def getItems(self):
|
||||
"""Return all items of the roster"""
|
||||
return list(self._jids.values())
|
||||
|
|
|
|||
Loading…
Reference in a new issue