diff src/browser/sat_browser/chat.py @ 834:2491898b3041

browser (chat, notification): remove the textual alerts counter, merge it with the favicon counter
author souliane <souliane@mailoo.org>
date Tue, 12 Jan 2016 17:59:07 +0100
parents 4db064a70fc7
children fa29524774d6
line wrap: on
line diff
--- a/src/browser/sat_browser/chat.py	Tue Jan 12 16:55:43 2016 +0100
+++ b/src/browser/sat_browser/chat.py	Tue Jan 12 17:59:07 2016 +0100
@@ -219,6 +219,7 @@
         @param extra (dict): message data
         @param link_cb: method to call when the info is clicked, ignored if type_ is not 'link'
         """
+        QuickChat.printInfo(self, msg, type_, extra)
         if extra is None:
             extra = {}
         if type_ == 'normal':
@@ -238,11 +239,20 @@
         self.content_scroll.scrollToBottom()
 
     def printMessage(self, nick, my_message, message, timestamp, extra=None, profile=C.PROF_KEY_NONE):
+        QuickChat.printMessage(self, nick, my_message, message, timestamp, extra, profile)
         if extra is None:
             extra = {}
         self.content.add(ChatText(timestamp, nick, my_message, message, extra))
         self.content_scroll.scrollToBottom()
 
+    def notify(self, contact="somebody", msg=""):
+        """Notify the user of a new message if primitivus doesn't have the focus.
+
+        @param contact (unicode): contact who wrote to the users
+        @param msg (unicode): the message that has been received
+        """
+        self.host.notification.notify(contact, msg)
+
     def printDayChange(self, day):
         """Display the day on a new line.