changeset 2018:7199e6bdb94e

quick_frontend, primitivus (chat): fixed widget bad locking + don't send notification when locked
author Goffi <goffi@goffi.org>
date Sun, 24 Jul 2016 17:59:24 +0200
parents 7aa58b7a47e2
children c0ff84243650
files frontends/src/primitivus/chat.py frontends/src/quick_frontend/quick_chat.py
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py	Sun Jul 24 17:56:18 2016 +0200
+++ b/frontends/src/primitivus/chat.py	Sun Jul 24 17:59:24 2016 +0200
@@ -442,6 +442,11 @@
 
             # notifications
 
+            if self._locked:
+                # we don't want notifications when locked
+                # because that's history messages
+                return
+
             if wid.mess_data.mention:
                 from_jid = wid.mess_data.from_jid
                 msg = _(u'You have been mentioned by {nick} in {room}'.format(
--- a/frontends/src/quick_frontend/quick_chat.py	Sun Jul 24 17:56:18 2016 +0200
+++ b/frontends/src/quick_frontend/quick_chat.py	Sun Jul 24 17:59:24 2016 +0200
@@ -153,7 +153,7 @@
         """
         self.lang = ''  # default language to use for messages
         quick_widgets.QuickWidget.__init__(self, host, target, profiles=profiles)
-        self._locked = False  # True when we are waiting for history/search
+        self._locked = True   # True when we are waiting for history/search
                               # messageNew signals are cached when locked
         self._cache = []
         assert type_ in (C.CHAT_ONE2ONE, C.CHAT_GROUP)