From 90fcacd4bda3ccfd4b839f78ca2efadbbfd05600 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 8 Jul 2019 19:11:29 +0200 Subject: [PATCH] primitivus (contact list): fixed notifications counter for mentions: notifications counter was not properly counting mentions and was not changing colour as expected, this patch fixes this and changed colour to the more readable light red when not focused. fixes 319 --- sat_frontends/primitivus/constants.py | 2 +- sat_frontends/primitivus/contact_list.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sat_frontends/primitivus/constants.py b/sat_frontends/primitivus/constants.py index c7848693..a4bb1417 100644 --- a/sat_frontends/primitivus/constants.py +++ b/sat_frontends/primitivus/constants.py @@ -33,7 +33,7 @@ class Const(constants.Const): ("default_focus", "default,bold", "default"), ("cl_notifs", "yellow", "default"), ("cl_notifs_focus", "yellow,bold", "default"), - ("cl_mention", "dark red", "default"), + ("cl_mention", "light red", "default"), ("cl_mention_focus", "dark red,bold", "default"), # Messages ("date", "light gray", "default"), diff --git a/sat_frontends/primitivus/contact_list.py b/sat_frontends/primitivus/contact_list.py index 9b5815eb..441b81a6 100644 --- a/sat_frontends/primitivus/contact_list.py +++ b/sat_frontends/primitivus/contact_list.py @@ -224,12 +224,12 @@ class ContactList(PrimitivusWidget, QuickContactList): notifs = list( self.host.getNotifs(entity, exact_jid=special, profile=self.profile) ) - if notifs: - header = [("cl_notifs", u"({})".format(len(notifs))), u" "] - if list( + mentions = list( self.host.getNotifs(entity.bare, C.NOTIFY_MENTION, profile=self.profile) - ): - header = ("cl_mention", header) + ) + if notifs or mentions: + attr = 'cl_mention' if mentions else 'cl_notifs' + header = [(attr, u"({})".format(len(notifs) + len(mentions))), u" "] else: header = u""