Commit adf5c7a829
Unsigned
Layout: unified · split
src/render.rs +17 −2
| @@ -83,12 +83,22 @@ pub trait Render { | ||
| 83 | 83 | Self::TAGS.iter().map(|t| t.to_string()).collect() |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | fn event_tags(&self, event_id: &EventId, sender: &UserId) -> Vec<String> { | |
| 86 | fn event_tags( | |
| 87 | &self, | |
| 88 | event_id: &EventId, | |
| 89 | sender: &UserId, | |
| 90 | nick: &str, | |
| 91 | color_name: &str, | |
| 92 | ) -> Vec<String> { | |
| 87 | 93 | let mut tags = self.tags(); |
| 88 | 94 | let event_tag = format!("matrix_id_{}", event_id.as_str()); |
| 89 | 95 | let sender_tag = format!("matrix_sender_{}", sender.as_str()); |
| 96 | let nick_tag = format!("nick_{}", nick); | |
| 97 | let color = format!("prefix_nick_{}", color_name); | |
| 90 | 98 | tags.push(event_tag); |
| 91 | 99 | tags.push(sender_tag); |
| 100 | tags.push(nick_tag); | |
| 101 | tags.push(color); | |
| 92 | 102 | |
| 93 | 103 | tags |
| 94 | 104 | } |
| @@ -112,7 +122,12 @@ pub trait Render { | ||
| 112 | 122 | .unwrap_or_default() |
| 113 | 123 | .as_secs(); |
| 114 | 124 | |
| 115 | let tags = self.event_tags(event_id, &sender.user_id()); | |
| 125 | let tags = self.event_tags( | |
| 126 | event_id, | |
| 127 | &sender.user_id(), | |
| 128 | &sender.nick(), | |
| 129 | sender.color(), | |
| 130 | ); | |
| 116 | 131 | |
| 117 | 132 | for line in &mut content.lines { |
| 118 | 133 | line.tags = tags.clone(); |
src/room/members.rs +1 −1
| @@ -342,7 +342,7 @@ impl WeechatRoomMember { | ||
| 342 | 342 | self.inner.display_name() |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | fn color(&self) -> &str { | |
| 345 | pub fn color(&self) -> &str { | |
| 346 | 346 | &self.color |
| 347 | 347 | } |
| 348 | 348 | |