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(message-builder): move static helper methods to functions #5652

Merged
merged 4 commits into from
Oct 18, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 17, 2024

These functions shouldn't live in the message builder. They're related to IRC and Ignores.
IRC related functions are in TwitchIrc and in the chatterino::twitchirc namespace. All functions were copied. Only parameters equal to originalMessage were renamed to content to avoid confusion with the original message text, which might be bigger.

In the future, we should get rid of the ints in this code.

clang-tidy will complain, but I didn't change anything.

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/providers/twitch/TwitchIrc.cpp Show resolved Hide resolved
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/providers/twitch/TwitchIrc.cpp Show resolved Hide resolved
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

parameters equal to originalMessage were renamed to content to avoid confusion with the original message text, which might be bigger.

I don't understand the reasoning behind the change - I don't really care too much about it, but I don't see how originalMessage would be incorrect

src/providers/twitch/TwitchIrc.hpp Outdated Show resolved Hide resolved
tests/src/TwitchIrc.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrc.hpp Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@Nerixyz
Copy link
Contributor Author

Nerixyz commented Oct 18, 2024

but I don't see how originalMessage would be incorrect

It's not incorrect, but it's misleading. For the reply @user foo bar, the content could be foo bar. Yes, foo bar is originalMessage_ of MessageBuilder, but it's not the "original" message - that would be @user foo bar.

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/providers/twitch/TwitchIrc.cpp Show resolved Hide resolved
@pajlada
Copy link
Member

pajlada commented Oct 18, 2024

but I don't see how originalMessage would be incorrect

It's not incorrect, but it's misleading. For the reply @user foo bar, the content could be foo bar. Yes, foo bar is originalMessage_ of MessageBuilder, but it's not the "original" message - that would be @user foo bar.

Sure, I guess that depends on how you interpret "message" and "content". Libcommuni interprets "content" as @user foo bar

@pajlada pajlada merged commit 800f6df into Chatterino:master Oct 18, 2024
18 checks passed
@Nerixyz Nerixyz deleted the refactor/move-irc-funcs branch October 18, 2024 11:15
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