primitivus (chat): mention is now visible by date in red instead of body (or a "[*]" if date is hidden)
This commit is contained in:
parent
2e204f182a
commit
a16d8bfc01
1 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue