comparison src/browser/sat_browser/contact_widget.py @ 693:1d60fa4d25a4

browser_side: fixes new message alerts
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 13:29:26 +0200
parents 16079280a39e
children d3fa1e8904cf
comparison
equal deleted inserted replaced
692:7a9c7b9f6a28 693:1d60fa4d25a4
29 from pyjamas.ui.ClickListener import ClickHandler 29 from pyjamas.ui.ClickListener import ClickHandler
30 from constants import Const as C 30 from constants import Const as C
31 import html_tools 31 import html_tools
32 import base_widget 32 import base_widget
33 import libervia_widget 33 import libervia_widget
34 import contact_list
34 35
35 unicode = str # XXX: pyjama doesn't manage unicode 36 unicode = str # XXX: pyjama doesn't manage unicode
36 37
37 38
38 class ContactLabel(HTML): 39 class ContactLabel(HTML):
54 self.alert = False 55 self.alert = False
55 self.setStyleName('contactLabel') 56 self.setStyleName('contactLabel')
56 57
57 def update(self): 58 def update(self):
58 clist = self.host.contact_list 59 clist = self.host.contact_list
59 alert_html = "<strong>(*)</strong>&nbsp;" if self.jid in clist._alerts else "" 60 alerts = clist._alerts if self.jid.resource else contact_list.JIDList([contact.bare for contact in clist._alerts])
61 alert_html = "<strong>(*)</strong>&nbsp;" if self.jid in alerts else ""
60 62
61 contact_raw = None 63 contact_raw = None
62 for disp in self.display: 64 for disp in self.display:
63 if disp == "jid": 65 if disp == "jid":
64 contact_raw = unicode(self.jid) 66 contact_raw = unicode(self.jid)