Skip to content
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

fix: mark holiday notice messages as bot-generated #6374

Merged
merged 1 commit into from
Jan 1, 2025
Merged

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Dec 29, 2024

Closes #6373

@link2xt link2xt requested review from iequidoo and removed request for iequidoo December 29, 2024 07:33
== Some(&"auto-generated".to_string())
&& parser.headers.contains_key("chat-version");
let is_bot =
parser.headers.get("auto-submitted") == Some(&"auto-generated".to_string());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.as_deref() probably can be used for the lhs to avoid to_string()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried and this does not work because of the cursed &String type inside the return type of get. as_deref() changes nothing, it is still Option<&String> afterwards.

@link2xt link2xt merged commit 25933b1 into main Jan 1, 2025
36 of 37 checks passed
@link2xt link2xt deleted the link2xt/msg-is_bot branch January 1, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-generated non-chat messages should be marked with Bot param
2 participants