# HG changeset patch # User Goffi # Date 1562605889 -7200 # Node ID d58dccd9e4b4ee62898a4cc278a4df26e2fdc103 # Parent 4d5b9d4c74483dcb0a5f3b41455fc16812b8300a 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 diff -r 4d5b9d4c7448 -r d58dccd9e4b4 sat_frontends/primitivus/constants.py --- a/sat_frontends/primitivus/constants.py Mon Jul 08 09:20:06 2019 +0200 +++ b/sat_frontends/primitivus/constants.py Mon Jul 08 19:11:29 2019 +0200 @@ -33,7 +33,7 @@ ("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 -r 4d5b9d4c7448 -r d58dccd9e4b4 sat_frontends/primitivus/contact_list.py --- a/sat_frontends/primitivus/contact_list.py Mon Jul 08 09:20:06 2019 +0200 +++ b/sat_frontends/primitivus/contact_list.py Mon Jul 08 19:11:29 2019 +0200 @@ -224,12 +224,12 @@ 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""