comparison sat_frontends/quick_frontend/quick_contact_list.py @ 3189:142ecb7f6338

quick frontend(contact list): new "isInRoster" method
author Goffi <goffi@goffi.org>
date Wed, 26 Feb 2020 22:03:15 +0100
parents 9d0df638c8b4
children 6cf4bd6972c2
comparison
equal deleted inserted replaced
3188:a15773c6c273 3189:142ecb7f6338
133 133
134 def __contains__(self, entity): 134 def __contains__(self, entity):
135 """Check if entity is in contact list 135 """Check if entity is in contact list
136 136
137 An entity can be in contact list even if not in roster 137 An entity can be in contact list even if not in roster
138 use isInRoster to check if entity is in roster.
138 @param entity (jid.JID): jid of the entity (resource is not ignored, 139 @param entity (jid.JID): jid of the entity (resource is not ignored,
139 use bare jid if needed) 140 use bare jid if needed)
140 """ 141 """
141 if entity.resource: 142 if entity.resource:
142 try: 143 try:
361 @return: registered value 362 @return: registered value
362 """ 363 """
363 if name is None: 364 if name is None:
364 return self._groups[group] 365 return self._groups[group]
365 return self._groups[group][name] 366 return self._groups[group][name]
367
368 def isInRoster(self, entity):
369 """Tell if an entity is in roster
370
371 @param entity(jid.JID): jid of the entity
372 the bare jid will be used
373 """
374 return entity.bare in self._roster
366 375
367 def isRoom(self, entity): 376 def isRoom(self, entity):
368 """Helper method to know if entity is a MUC room 377 """Helper method to know if entity is a MUC room
369 378
370 @param entity(jid.JID): jid of the entity 379 @param entity(jid.JID): jid of the entity