@@ -676,22 +676,23 @@ def main_view(self) -> List[Any]:
676
676
677
677
if any_differences : # Construct content_header, if needed
678
678
text_keys = ("author" , "star" , "time" , "status" )
679
- text : Dict [str , urwid_MarkupTuple ] = {key : (None , " " ) for key in text_keys }
679
+ text : Dict [str , List [urwid_MarkupTuple ]] = {
680
+ key : [(None , " " )] for key in text_keys
681
+ }
680
682
681
683
if any (
682
684
different [key ] for key in ("recipients" , "author" , "author_id" , "24h" )
683
685
):
684
686
if self .model .is_user_name_duplicate (message ["this" ]["author" ]):
685
- text ["author" ] = (
686
- "msg_sender" ,
687
- message ["this" ]["author" ]
688
- + " "
689
- + "("
690
- + str (message ["this" ]["author_id" ])
691
- + ")" ,
692
- )
687
+ text ["author" ] = [
688
+ ("msg_sender" , message ["this" ]["author" ]),
689
+ (
690
+ "msg_mention" ,
691
+ " " + "(" + str (message ["this" ]["author_id" ]) + ")" ,
692
+ ),
693
+ ]
693
694
else :
694
- text ["author" ] = ("msg_sender" , message ["this" ]["author" ])
695
+ text ["author" ] = [ ("msg_sender" , message ["this" ]["author" ])]
695
696
# TODO: Refactor to use user ids for look up instead of emails.
696
697
email = self .message .get ("sender_email" , "" )
697
698
user = self .model .user_dict .get (email , None )
@@ -701,17 +702,17 @@ def main_view(self) -> List[Any]:
701
702
702
703
# The default text['status'] value is (None, ' ')
703
704
if status in STATE_ICON :
704
- text ["status" ] = (f"user_{ status } " , STATE_ICON [status ])
705
+ text ["status" ] = [ (f"user_{ status } " , STATE_ICON [status ])]
705
706
706
707
if message ["this" ]["is_starred" ]:
707
- text ["star" ] = ("starred" , "*" )
708
+ text ["star" ] = [ ("starred" , "*" )]
708
709
if any (different [key ] for key in ("recipients" , "author" , "timestamp" )):
709
710
this_year = date .today ().year
710
711
msg_year = message ["this" ]["datetime" ].year
711
712
if this_year != msg_year :
712
- text ["time" ] = ("time" , f"{ msg_year } - { message ['this' ]['time' ]} " )
713
+ text ["time" ] = [ ("time" , f"{ msg_year } - { message ['this' ]['time' ]} " )]
713
714
else :
714
- text ["time" ] = ("time" , message ["this" ]["time" ])
715
+ text ["time" ] = [ ("time" , message ["this" ]["time" ])]
715
716
716
717
content_header = urwid .Columns (
717
718
[
0 commit comments