comparison src/core/xmpp.py @ 2139:f8401024ab28

core (roster): added isPresenceAuthorised to check if an entity is authorised to see our presence
author Goffi <goffi@goffi.org>
date Mon, 06 Feb 2017 20:46:59 +0100
parents cc3a6aea9508
children 1d3f73e065e1
comparison
equal deleted inserted replaced
2138:6e509ee853a8 2139:f8401024ab28
428 428
429 def isJidInRoster(self, entity_jid): 429 def isJidInRoster(self, entity_jid):
430 """Return True if jid is in roster""" 430 """Return True if jid is in roster"""
431 return entity_jid in self._jids 431 return entity_jid in self._jids
432 432
433 def isPresenceAuthorised(self, entity_jid):
434 """Return True if entity is authorised to see our presence"""
435 import pudb
436 pudb.set_trace()
437 try:
438 item = self._jids[entity_jid.userhostJID()]
439 except KeyError:
440 return False
441 return item.subscriptionFrom
442
433 def getItems(self): 443 def getItems(self):
434 """Return all items of the roster""" 444 """Return all items of the roster"""
435 return self._jids.values() 445 return self._jids.values()
436 446
437 def getJidsFromGroup(self, group): 447 def getJidsFromGroup(self, group):