Skip to content

Commit

Permalink
Highlights buffer now includes Action messages
Browse files Browse the repository at this point in the history
  • Loading branch information
englut committed Dec 12, 2024
1 parent 413d32a commit 048fad4
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion src/buffer/highlights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,50 @@ pub fn view<'a>(
)
.into(),
)
}
},
message::Target::Highlights {
server,
channel,
source: message::Source::Action(_),
} => {
let timestamp =
config
.buffer
.format_timestamp(&message.server_time)
.map(|timestamp| {
selectable_text(timestamp).style(theme::selectable_text::timestamp)
});

let channel_text = selectable_rich_text::<_, _, (), _, _>(vec![
span(channel.as_str())
.color(theme.colors().buffer.url)
.link(message::Link::GoToMessage(
server.clone(),
channel.clone(),
message.hash,
)),
span(" "),
])
.on_link(scroll_view::Message::Link);

let text = message_content(
&message.content,
theme,
scroll_view::Message::Link,
theme::selectable_text::action,
config,
);

Some(
container(
row![]
.push_maybe(timestamp)
.push(channel_text)
.push(text),
)
.into(),
)
},
_ => None,
},
)
Expand Down

0 comments on commit 048fad4

Please sign in to comment.