Skip to content

Commit

Permalink
Simplify highlight box for /me action
Browse files Browse the repository at this point in the history
  • Loading branch information
englut committed Dec 16, 2024
1 parent f0c6e33 commit 3506255
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/buffer/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,14 @@ pub fn view<'a>(
config,
);

let text_container =
container(message_content).style(move |theme| match user {
Some(user) => match our_nick {
Some(nick)
if message::references_user(
user.nickname(),
nick,
message,
) =>
{
theme::container::highlight(theme)
}
_ => Default::default(),
},
_ => Default::default(),
});
let text_container = container(message_content).style(move |theme| {
if let (Some(user), Some(nick)) = (user, our_nick) {
if message::references_user(user.nickname(), nick, message) {
return theme::container::highlight(theme);
}
}
Default::default()
});

Some(
container(
Expand Down

0 comments on commit 3506255

Please sign in to comment.