Commit e5b284ed19
Unregistered key
Layout: unified · split
src/config.rs +6 −5
| @@ -912,15 +912,16 @@ impl ApplicationSettings { | ||
| 912 | 912 | .unwrap_or_default() |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | pub fn get_user_style(&self, user_id: &UserId) -> Style { | |
| 916 | let color = self | |
| 917 | .tunables | |
| 915 | pub fn get_user_color(&self, user_id: &UserId) -> Color { | |
| 916 | self.tunables | |
| 918 | 917 | .users |
| 919 | 918 | .get(user_id) |
| 920 | 919 | .and_then(|user| user.color.as_ref().map(|c| c.0)) |
| 921 | .unwrap_or_else(|| user_color(user_id.as_str())); | |
| 920 | .unwrap_or_else(|| user_color(user_id.as_str())) | |
| 921 | } | |
| 922 | 922 | |
| 923 | user_style_from_color(color) | |
| 923 | pub fn get_user_style(&self, user_id: &UserId) -> Style { | |
| 924 | user_style_from_color(self.get_user_color(user_id)) | |
| 924 | 925 | } |
| 925 | 926 | |
| 926 | 927 | pub fn get_user_span<'a>(&self, user_id: &'a UserId, info: &'a RoomInfo) -> Span<'a> { |
src/message/mod.rs +1 −1
| @@ -863,7 +863,7 @@ impl Message { | ||
| 863 | 863 | } |
| 864 | 864 | |
| 865 | 865 | if settings.tunables.message_user_color { |
| 866 | let color = crate::config::user_color(self.sender.as_str()); | |
| 866 | let color = settings.get_user_color(&self.sender); | |
| 867 | 867 | style = style.fg(color); |
| 868 | 868 | } |
| 869 | 869 | |