diff frontends/src/primitivus/primitivus @ 1336:2ecc07a8f91b frontends_multi_profiles

primitivus, quick_frontends: moved newMessage signal handler to quick_frontend
author Goffi <goffi@goffi.org>
date Mon, 23 Feb 2015 18:04:25 +0100
parents faa1129559b8
children f29beedb33b0
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus	Mon Feb 23 18:04:25 2015 +0100
+++ b/frontends/src/primitivus/primitivus	Mon Feb 23 18:04:25 2015 +0100
@@ -530,8 +530,8 @@
 
     def removeWindow(self):
         """Remove window showed on the right column"""
-        #TODO: to a better Window management than this crappy hack
-        assert(len(self.center_part.widget_list)<=2)
+        #TODO: better Window management than this hack
+        assert len(self.center_part.widget_list) <= 2
         wid_idx = len(self.center_part.widget_list)-1
         self.center_part.widget_list[wid_idx] = urwid.Filler(urwid.Text(''))
         self.center_part.focus_position = 0
@@ -556,21 +556,6 @@
         self.selectWidget(chat_widget)
         self.menu_roller.addMenu(_('Chat menu'), chat_widget.getMenu(), C.MENU_ID_WIDGET)
 
-    def newMessageHandler(self, from_jid, to_jid, msg, type_, extra, profile):
-        QuickApp.newMessageHandler(self, from_jid, to_jid, msg, type_, extra, profile)
-
-        if not from_jid in self.contact_lists[profile] and from_jid.bare != self.profiles[profile].whoami.bare:
-            #XXX: needed to show entities which haven't sent any
-            #     presence information and which are not in roster
-            self.contact_lists[profile].setContact(from_jid)
-        visible = False
-        for widget in self.visible_widgets:
-            if isinstance(widget, Chat) and widget.manageMessage(from_jid, type_):
-                visible = True
-                break
-        if not visible:
-            self.contact_lists[profile].setAlert(from_jid.bare if type_ == C.MESS_TYPE_GROUPCHAT else from_jid)
-
     def _dialogOkCb(self, widget, data):
         self.removePopUp()
         answer_cb = data[0]