# HG changeset patch # User Goffi # Date 1409938175 -7200 # Node ID 19fc2ebc02dd072c12c1cba4a46824ff0f2b4f48 # Parent 1fa173107fde4824ad12f55445ae532cb372dabc browser_side: management of new "info" newMessage type diff -r 1fa173107fde -r 19fc2ebc02dd src/browser/libervia_main.py --- a/src/browser/libervia_main.py Fri Sep 05 12:26:33 2014 +0200 +++ b/src/browser/libervia_main.py Fri Sep 05 19:29:35 2014 +0200 @@ -717,13 +717,12 @@ self.newMessageCb(from_jid, msg, msg_type, to_jid, extra) def newMessageCb(self, from_jid, msg, msg_type, to_jid, extra): - # FIXME: newMessage should manage system message, so they don't appear as coming from the contact other = to_jid if from_jid.bare == self.whoami.bare else from_jid lib_wid = self.getLiberviaWidget(panels.ChatPanel, other, ignoreOtherTabs=False) self.displayNotification(from_jid, msg) if msg_type == 'headline' and from_jid.full() == self._defaultDomain: try: - assert(extra['subject']) # subject is defined and not empty + assert extra['subject'] # subject is defined and not empty title = extra['subject'] except (KeyError, AssertionError): title = _('Announcement from %s') % from_jid.full() @@ -731,8 +730,12 @@ dialog.InfoDialog(title, msg).show() return if lib_wid is not None: - lib_wid.printMessage(from_jid, msg, extra) + if msg_type == C.MESS_TYPE_INFO: + lib_wid.printInfo(msg) + else: + lib_wid.printMessage(from_jid, msg, extra) else: + # FIXME: "info" message will be lost here if not self.contact_panel.isContactInRoster(other.bare): self.contact_panel.updateContact(other.bare, {}, [C.GROUP_NOT_IN_ROSTER]) # The message has not been shown, we must indicate it diff -r 1fa173107fde -r 19fc2ebc02dd src/browser/sat_browser/plugin_sec_otr.py --- a/src/browser/sat_browser/plugin_sec_otr.py Fri Sep 05 12:26:33 2014 +0200 +++ b/src/browser/sat_browser/plugin_sec_otr.py Fri Sep 05 19:29:35 2014 +0200 @@ -332,6 +332,8 @@ self.host.bridge.call('getLastResource', gotResource, jid.full()) def messageReceivedTrigger(self, from_jid, msg, msg_type, to_jid, extra): + if msg_type == C.MESS_TYPE_INFO: + return True other_jid = to_jid if from_jid.bare == self.host.whoami.bare else from_jid def cb(jid):