diff --git a/frontends/src/primitivus/chat.py b/frontends/src/primitivus/chat.py index 858f93ce..1653e7e5 100644 --- a/frontends/src/primitivus/chat.py +++ b/frontends/src/primitivus/chat.py @@ -117,12 +117,17 @@ class MessageWidget(urwid.WidgetWrap): """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 @@ class MessageWidget(urwid.WidgetWrap): 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