# HG changeset patch # User Goffi # Date 1467131468 -7200 # Node ID 2a85c818751acfcab269b2e75beda26a90cb1233 # Parent 70e83ca721c8903f872d3e601b311bc061ffa1b5 primitivus (chat): mention is now visible by date in red instead of body (or a "[*]" if date is hidden) diff -r 70e83ca721c8 -r 2a85c818751a frontends/src/primitivus/chat.py --- a/frontends/src/primitivus/chat.py Tue Jun 28 18:29:56 2016 +0200 +++ b/frontends/src/primitivus/chat.py Tue Jun 28 18:31:08 2016 +0200 @@ -117,12 +117,17 @@ """Generate text markup according to message data and Widget options""" markup = [] d = self.mess_data + mention = d.mention # timestamp if self.parent.show_timestamp: # if the message was sent before today, we print the full date time_format = u"%c" if self.timestamp < self.parent.day_change else u"%H:%M" - markup.append(('date', u"[{}]".format(time.strftime(time_format, self.timestamp).decode(locale.getlocale()[1])))) + attr = 'msg_mention' if mention else 'date' + markup.append((attr, u"[{}]".format(time.strftime(time_format, self.timestamp).decode(locale.getlocale()[1])))) + else: + if mention: + markup.append(('msg_mention', '[*]')) # nickname if self.parent.show_short_nick: @@ -136,10 +141,7 @@ markup.append(("msg_lang", u"[{}] ".format(self.selected_lang))) # message body - if d.mention: - markup.append(("msg_mention", msg)) - else: - markup.append(msg) + markup.append(msg) return markup