core (roster): added isPresenceAuthorised to check if an entity is authorised to see our presence
This commit is contained in:
parent
aeeb0c5635
commit
7865ae7f99
1 changed files with 10 additions and 0 deletions
|
|
@ -430,6 +430,16 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
|
|||
"""Return True if jid is in roster"""
|
||||
return entity_jid in self._jids
|
||||
|
||||
def isPresenceAuthorised(self, entity_jid):
|
||||
"""Return True if entity is authorised to see our presence"""
|
||||
import pudb
|
||||
pudb.set_trace()
|
||||
try:
|
||||
item = self._jids[entity_jid.userhostJID()]
|
||||
except KeyError:
|
||||
return False
|
||||
return item.subscriptionFrom
|
||||
|
||||
def getItems(self):
|
||||
"""Return all items of the roster"""
|
||||
return self._jids.values()
|
||||
|
|
|
|||
Loading…
Reference in a new issue