-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlight notifications for /me
actions.
#674
Highlight notifications for /me
actions.
#674
Conversation
6dbe956
to
048fad4
Compare
/me
actions.
048fad4
to
76f49d4
Compare
src/buffer/channel.rs
Outdated
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(), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be simplified a bit, not tested but something like:
let text_container = container(message_content).style(|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()
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! That's so much nicer. I didn't know that you could combine the Some(..)
assignment that way. I did think that there was something to optimize there! Thanks for this 🙏
The simplification has been tested and pushed!
bd8af8d
to
3506255
Compare
3506255
to
3d97d05
Compare
I noticed that highlights in query weren't present. I've added this to the PR. |
903df07
to
41d2e61
Compare
Found bugs with highlighting notifications when someone mentions you with a
/me
action.There's three related issues:
/me
action highlights are not triggered./me
action is not visually highlighted./me
action highlights not showing in Highlights buffer.Above issues should be addressed with this PR.