Commit 4b9619902e
Unsigned
Layout: unified · split
src/render.rs +10 −1
| @@ -91,8 +91,17 @@ impl RenderableEvent for MessageEvent { | |||
| 91 | fn render(&self, displayname: &str) -> String { | 91 | fn render(&self, displayname: &str) -> String { |
| 92 | use MessageEventContent::*; | 92 | use MessageEventContent::*; |
| 93 | 93 | ||
| 94 | let color_user = Weechat::color("green"); // TODO: get per-user color | 94 | // TODO: Need to render power level indicators as well. |
| 95 | |||
| 96 | // In case it's not clear, self.sender is the MXID. We're basing the nick color on it so | ||
| 97 | // that it doesn't change with display name changes. | ||
| 98 | let colorname_user = | ||
| 99 | Weechat::info_get("nick_color_name", self.sender.as_ref()) | ||
| 100 | .unwrap_or(String::from("default")); | ||
| 101 | let color_user = Weechat::color(&colorname_user); | ||
| 102 | |||
| 95 | let color_reset = Weechat::color("reset"); | 103 | let color_reset = Weechat::color("reset"); |
| 104 | |||
| 96 | match &self.content { | 105 | match &self.content { |
| 97 | // TODO: formatting for inline markdown and so on | 106 | // TODO: formatting for inline markdown and so on |
| 98 | Text(t) => format!( | 107 | Text(t) => format!( |