diff 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
line wrap: on
line diff
--- a/src/browser/sat_browser/contact_widget.py	Tue Nov 24 11:00:26 2015 +0100
+++ b/src/browser/sat_browser/contact_widget.py	Tue Nov 24 13:33:19 2015 +0100
@@ -57,8 +57,8 @@
 
     def update(self):
         clist = self.host.contact_list
-        alerts = clist._alerts if self.jid.resource else contact_list.JIDList([contact.bare for contact in clist._alerts])
-        alert_html = "<strong>(*)</strong>&nbsp;" if self.jid in alerts else ""
+        alerts_count = clist.getAlerts(self.jid, use_bare_jid=not self.jid.resource)
+        alert_html = ("<strong>(%i)</strong>&nbsp;" % alerts_count) if alerts_count else ""
 
         contact_raw = None
         for disp in self.display: