comparison src/browser/sat_browser/contact_widget.py @ 754:d3fa1e8904cf

browser_side: display the number of alerts for each contact and not only a symbol (*) + favicon displays the total number of waiting messages
author souliane <souliane@mailoo.org>
date Tue, 24 Nov 2015 13:33:19 +0100
parents 1d60fa4d25a4
children f8a7a046ff9c
comparison
equal deleted inserted replaced
753:76a9c074327b 754:d3fa1e8904cf
55 self.alert = False 55 self.alert = False
56 self.setStyleName('contactLabel') 56 self.setStyleName('contactLabel')
57 57
58 def update(self): 58 def update(self):
59 clist = self.host.contact_list 59 clist = self.host.contact_list
60 alerts = clist._alerts if self.jid.resource else contact_list.JIDList([contact.bare for contact in clist._alerts]) 60 alerts_count = clist.getAlerts(self.jid, use_bare_jid=not self.jid.resource)
61 alert_html = "<strong>(*)</strong>&nbsp;" if self.jid in alerts else "" 61 alert_html = ("<strong>(%i)</strong>&nbsp;" % alerts_count) if alerts_count else ""
62 62
63 contact_raw = None 63 contact_raw = None
64 for disp in self.display: 64 for disp in self.display:
65 if disp == "jid": 65 if disp == "jid":
66 contact_raw = unicode(self.jid) 66 contact_raw = unicode(self.jid)