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

refactor: irc message builder #5663

Merged
merged 11 commits into from
Oct 20, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 19, 2024

This PR refactors MessageBuilder for IRC messages. IRC messages are now build using a static makeIrcMessage. This way, MessageBuilder doesn't have to keep track of IRC-related state anymore (only the required state). This will make support for EventSub easier (hopefully).

While refactoring, I noticed that MessageBuilder::parseUsernameColor doesn't set Message::usernameColor if the color is overwritten by user-data. This change can be seen in the updated snapshots.

Building IRC messages also includes parsing highlights. The result of that is returned to the caller. Due to this, the Highlights benchmark is obsolete now. All of it is done inside the recent-messages benchmark. In the future, we could add a benchmark specifically for HighlightController::check.
MessageBuilder::triggerHighlights could also be moved to the HighlightController in the future.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/messages/MessageBuilder.cpp Outdated Show resolved Hide resolved
src/providers/twitch/IrcMessageHandler.cpp Outdated Show resolved Hide resolved
src/providers/twitch/IrcMessageHandler.cpp Outdated Show resolved Hide resolved
src/providers/twitch/IrcMessageHandler.cpp Outdated Show resolved Hide resolved
src/providers/twitch/IrcMessageHandler.cpp Outdated Show resolved Hide resolved
tests/src/Filters.cpp Outdated Show resolved Hide resolved
tests/src/Filters.cpp Outdated Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) October 20, 2024 09:56
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/messages/MessageBuilder.cpp Outdated Show resolved Hide resolved
@pajlada pajlada merged commit e35fabf into Chatterino:master Oct 20, 2024
18 checks passed
@Nerixyz Nerixyz deleted the refactor/irc-message-builder branch October 20, 2024 15: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.

2 participants