Commit d44f861871
Unregistered key
Layout: unified · split
src/message/mod.rs +11 −5
| @@ -727,22 +727,28 @@ impl<'a> MessageFormatter<'a> { | ||
| 727 | 727 | info: &'a RoomInfo, |
| 728 | 728 | settings: &'a ApplicationSettings, |
| 729 | 729 | ) -> 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 | ||
| 730 | 736 | let width = self.width(); |
| 731 | 737 | 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); | |
| 733 | 739 | let mut sender = msg.sender_span(info, self.settings); |
| 734 | 740 | let sender_width = UnicodeWidthStr::width(sender.content.as_ref()); |
| 735 | 741 | let trailing = w.saturating_sub(sender_width + 1); |
| 736 | 742 | |
| 737 | sender.style = sender.style.patch(style); | |
| 743 | sender.style = sender.style.patch(reply_style); | |
| 738 | 744 | |
| 739 | 745 | self.push_spans( |
| 740 | 746 | Line::from(vec![ |
| 741 | 747 | Span::styled(" ", style), |
| 742 | 748 | Span::styled(THICK_VERTICAL, style), |
| 743 | 749 | sender, |
| 744 | Span::styled(":", style), | |
| 745 | space_span(trailing, style), | |
| 750 | Span::styled(":", reply_style), | |
| 751 | space_span(trailing, reply_style), | |
| 746 | 752 | ]), |
| 747 | 753 | style, |
| 748 | 754 | text, |
| @@ -761,7 +767,7 @@ impl<'a> MessageFormatter<'a> { | ||
| 761 | 767 | line.spans.insert(0, Span::styled(" ", style)); |
| 762 | 768 | } |
| 763 | 769 | |
| 764 | self.push_text(replied, style, text); | |
| 770 | self.push_text(replied, reply_style, text); | |
| 765 | 771 | |
| 766 | 772 | proto |
| 767 | 773 | } |