From e72f7d728c78e3870e30181f59f2d10f3f3631b7 Mon Sep 17 00:00:00 2001 From: souliane Date: Fri, 22 Aug 2014 12:31:55 +0200 Subject: [PATCH] primitivus: prevent a notification flood when displaying the history --- frontends/src/primitivus/chat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontends/src/primitivus/chat.py b/frontends/src/primitivus/chat.py index 9543d099..c4b58193 100644 --- a/frontends/src/primitivus/chat.py +++ b/frontends/src/primitivus/chat.py @@ -300,7 +300,11 @@ class Chat(urwid.WidgetWrap, QuickChat): break else: self.content.append(new_text) - self._notify(from_jid, msg) + if not timestamp: + # XXX: do not send notifications for each line of the history being displayed + # FIXME: this must be changed in the future if the timestamp is passed with + # all messages and not only with the messages coming from the history. + self._notify(from_jid, msg) def printInfo(self, msg, type_='normal', timestamp=""): """Print general info