comparison frontends/src/quick_frontend/quick_contact_list.py @ 1408:8a7145138330

quick_frontend, primitivus: move code to remove a new message alert from primitivus to quick_frontend
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 13:31:14 +0200
parents 5c3d1d970b94
children 3265a2639182
comparison
equal deleted inserted replaced
1407:77f07ea90420 1408:8a7145138330
442 @param entity(jid.JID): entity which must displayed in alert mode (resource is significant) 442 @param entity(jid.JID): entity which must displayed in alert mode (resource is significant)
443 """ 443 """
444 self._alerts.add(entity) 444 self._alerts.add(entity)
445 self.update() 445 self.update()
446 446
447 def removeAlert(self, entity, use_bare_jid=True):
448 """Eventually remove an alert on the entity (usually for a waiting message).
449
450 @param entity(jid.JID): entity (resource is significant)
451 @param use_bare_jid (bool): if True, ignore the resource
452 """
453 if use_bare_jid:
454 to_remove = set()
455 for alert_entity in self._alerts:
456 if alert_entity.bare == entity.bare:
457 to_remove.add(alert_entity)
458 self._alerts.difference_update(to_remove)
459 else:
460 self._alerts.discard(entity)
461 self.update()
462
447 def _showOfflineContacts(self, show_str): 463 def _showOfflineContacts(self, show_str):
448 self.showOfflineContacts(C.bool(show_str)) 464 self.showOfflineContacts(C.bool(show_str))
449 465
450 def showOfflineContacts(self, show): 466 def showOfflineContacts(self, show):
451 """Tell if offline contacts should shown 467 """Tell if offline contacts should shown