comparison src/browser/libervia_main.py @ 645:122b4483dac4 frontends_multi_profiles

browser side: restored infoDialog for headline messages from server
author Goffi <goffi@goffi.org>
date Wed, 25 Feb 2015 19:40:23 +0100
parents 7692bbfe0b2f
children 9972a24592b0
comparison
equal deleted inserted replaced
644:7692bbfe0b2f 645:122b4483dac4
364 return contact_list 364 return contact_list
365 365
366 def newWidget(self, widget): 366 def newWidget(self, widget):
367 log.debug("newWidget: {}".format(widget)) 367 log.debug("newWidget: {}".format(widget))
368 self.addWidget(widget) 368 self.addWidget(widget)
369
370 def newMessageHandler(self, from_jid_s, msg, type_, to_jid_s, extra, profile):
371 if type_ == C.MESS_TYPE_HEADLINE:
372 from_jid = jid.JID(from_jid_s)
373 if from_jid.domain == self._defaultDomain:
374 # we display announcement from the server in a dialog for better visibility
375 try:
376 title = extra['subject']
377 except KeyError:
378 title = _('Announcement from %s') % from_jid
379 msg = strings.addURLToText(html_tools.XHTML2Text(msg))
380 dialog.InfoDialog(title, msg).show()
381 return
382 QuickApp.newMesageHandler(self, from_jid_s, msg, type_, to_jid_s, extra, profile)
369 383
370 def disconnectedHandler(self, profile): 384 def disconnectedHandler(self, profile):
371 QuickApp.disconnectedHandler(self, profile) 385 QuickApp.disconnectedHandler(self, profile)
372 Window.getLocation().reload() 386 Window.getLocation().reload()
373 387