Mercurial > libervia-web
comparison src/browser/libervia_main.py @ 460:d0cd8ae579f7
browser side: message of type "headline" sent from the host are displayed in a InfoDialog
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 02 Jun 2014 19:29:07 +0200 |
parents | 1eeed8028199 |
children | 07433bd892ee |
comparison
equal
deleted
inserted
replaced
459:36f27d1e64b2 | 460:d0cd8ae579f7 |
---|---|
676 _from = JID(from_jid) | 676 _from = JID(from_jid) |
677 _to = JID(to_jid) | 677 _to = JID(to_jid) |
678 other = _to if _from.bare == self.whoami.bare else _from | 678 other = _to if _from.bare == self.whoami.bare else _from |
679 lib_wid = self.getLiberviaWidget(panels.ChatPanel, other, ignoreOtherTabs=False) | 679 lib_wid = self.getLiberviaWidget(panels.ChatPanel, other, ignoreOtherTabs=False) |
680 self.displayNotification(_from, msg) | 680 self.displayNotification(_from, msg) |
681 if msg_type == 'headline' and from_jid == self._defaultDomain: | |
682 try: | |
683 assert(extra['subject']) # subject is defined and not empty | |
684 title = extra['subject'] | |
685 except (KeyError, AssertionError): | |
686 title = _('Announcement from %s') % from_jid | |
687 dialog.InfoDialog(title, msg).show() | |
688 return | |
681 if lib_wid is not None: | 689 if lib_wid is not None: |
682 lib_wid.printMessage(_from, msg, extra) | 690 lib_wid.printMessage(_from, msg, extra) |
683 else: | 691 else: |
684 if not self.contact_panel.isContactInRoster(other.bare): | 692 if not self.contact_panel.isContactInRoster(other.bare): |
685 self.contact_panel.updateContact(other.bare, {}, [C.GROUP_NOT_IN_ROSTER]) | 693 self.contact_panel.updateContact(other.bare, {}, [C.GROUP_NOT_IN_ROSTER]) |