changeset 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 36f27d1e64b2
children 4f25aa5039b3
files src/browser/libervia_main.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/libervia_main.py	Thu May 29 17:53:53 2014 +0200
+++ b/src/browser/libervia_main.py	Mon Jun 02 19:29:07 2014 +0200
@@ -678,6 +678,14 @@
         other = _to if _from.bare == self.whoami.bare else _from
         lib_wid = self.getLiberviaWidget(panels.ChatPanel, other, ignoreOtherTabs=False)
         self.displayNotification(_from, msg)
+        if msg_type == 'headline' and from_jid == self._defaultDomain:
+            try:
+                assert(extra['subject'])  # subject is defined and not empty
+                title = extra['subject']
+            except (KeyError, AssertionError):
+                title = _('Announcement from %s') % from_jid
+            dialog.InfoDialog(title, msg).show()
+            return
         if lib_wid is not None:
             lib_wid.printMessage(_from, msg, extra)
         else: