Commit d44f861871

d44f861871854a92fcf286dd60d494e15ac640b9

parent: 14aa97251c

Unregistered key

vaw <git@nlih.de> · 2025-10-25 19:54 UTC
committer: <noreply@github.com>

Respect user color of replied message with `message_user_color` (#532)

Layout: unified · split

src/message/mod.rs +11 −5
@@ -727,22 +727,28 @@ impl<'a> MessageFormatter<'a> {
727727 info: &'a RoomInfo,
728728 settings: &'a ApplicationSettings,
729729 ) -> Option<ProtocolPreview<'a>> {
730 let reply_style = if settings.tunables.message_user_color {
731 style.patch(settings.get_user_color(&msg.sender))
732 } else {
733 style
734 };
735
730736 let width = self.width();
731737 let w = width.saturating_sub(2);
732 let (mut replied, proto) = msg.show_msg(w, style, true, settings);
738 let (mut replied, proto) = msg.show_msg(w, reply_style, true, settings);
733739 let mut sender = msg.sender_span(info, self.settings);
734740 let sender_width = UnicodeWidthStr::width(sender.content.as_ref());
735741 let trailing = w.saturating_sub(sender_width + 1);
736742
737 sender.style = sender.style.patch(style);
743 sender.style = sender.style.patch(reply_style);
738744
739745 self.push_spans(
740746 Line::from(vec![
741747 Span::styled(" ", style),
742748 Span::styled(THICK_VERTICAL, style),
743749 sender,
744 Span::styled(":", style),
745 space_span(trailing, style),
750 Span::styled(":", reply_style),
751 space_span(trailing, reply_style),
746752 ]),
747753 style,
748754 text,
@@ -761,7 +767,7 @@ impl<'a> MessageFormatter<'a> {
761767 line.spans.insert(0, Span::styled(" ", style));
762768 }
763769
764 self.push_text(replied, style, text);
770 self.push_text(replied, reply_style, text);
765771
766772 proto
767773 }