quick frontend(contact list): new "isInRoster" method
This commit is contained in:
parent
48c56ee57e
commit
65dd411a2b
1 changed files with 9 additions and 0 deletions
|
|
@ -135,6 +135,7 @@ class ProfileContactList(object):
|
||||||
"""Check if entity is in contact list
|
"""Check if entity is in contact list
|
||||||
|
|
||||||
An entity can be in contact list even if not in roster
|
An entity can be in contact list even if not in roster
|
||||||
|
use isInRoster to check if entity is in roster.
|
||||||
@param entity (jid.JID): jid of the entity (resource is not ignored,
|
@param entity (jid.JID): jid of the entity (resource is not ignored,
|
||||||
use bare jid if needed)
|
use bare jid if needed)
|
||||||
"""
|
"""
|
||||||
|
|
@ -364,6 +365,14 @@ class ProfileContactList(object):
|
||||||
return self._groups[group]
|
return self._groups[group]
|
||||||
return self._groups[group][name]
|
return self._groups[group][name]
|
||||||
|
|
||||||
|
def isInRoster(self, entity):
|
||||||
|
"""Tell if an entity is in roster
|
||||||
|
|
||||||
|
@param entity(jid.JID): jid of the entity
|
||||||
|
the bare jid will be used
|
||||||
|
"""
|
||||||
|
return entity.bare in self._roster
|
||||||
|
|
||||||
def isRoom(self, entity):
|
def isRoom(self, entity):
|
||||||
"""Helper method to know if entity is a MUC room
|
"""Helper method to know if entity is a MUC room
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue