Mercurial > libervia-web
comparison src/browser/sat_browser/contact_widget.py @ 909:e8b133b77aa4
browser, server: update to get compatibility with 0.7-dev (not finished):
Q&D update to restore compatibility
- version changed to 0.7D
- contact list has been modified to be compatible with changes, but it doesn't take profit of improvment yet
- messageSend partially work, there is a disconnection and an error in console logs when sending a message
- message are not received yet
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 09 Aug 2016 01:07:15 +0200 |
parents | f8a7a046ff9c |
children | fd4eae654182 |
comparison
equal
deleted
inserted
replaced
908:f38b8be94131 | 909:e8b133b77aa4 |
---|---|
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 | |
35 | 34 |
36 unicode = str # XXX: pyjama doesn't manage unicode | 35 unicode = str # XXX: pyjama doesn't manage unicode |
37 | 36 |
38 | 37 |
39 class ContactLabel(HTML): | 38 class ContactLabel(HTML): |
55 self.alert = False | 54 self.alert = False |
56 self.setStyleName('contactLabel') | 55 self.setStyleName('contactLabel') |
57 | 56 |
58 def update(self): | 57 def update(self): |
59 clist = self.host.contact_list | 58 clist = self.host.contact_list |
60 alerts_count = clist.getAlerts(self.jid, use_bare_jid=not self.jid.resource) | 59 notifs = list(self.host.getNotifs(self.jid, exact_jid=False, profile=C.PROF_KEY_NONE)) |
60 alerts_count = len(notifs) | |
61 alert_html = ("<strong>(%i)</strong> " % alerts_count) if alerts_count else "" | 61 alert_html = ("<strong>(%i)</strong> " % 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": |