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

Migrate /emoteonly and /emoteonlyoff commands to the Helix API #4015

Merged
merged 16 commits into from
Oct 2, 2022

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Sep 28, 2022

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

This is the first part of updating commands that use the Update Chat Settings endpoint.

Fixes #3966, #3967.

@Nerixyz Nerixyz marked this pull request as ready for review September 28, 2022 11:12
Comment on lines +1808 to +1820
auto currentUser = getApp()->accounts->twitch.getCurrent();
if (currentUser->isAnon())
{
channel->addMessage(makeSystemMessage(
"You must be logged in to update chat settings!"));
return "";
}
auto *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
if (twitchChannel == nullptr)
{
channel->addMessage(makeSystemMessage(
"The /emoteonlyoff command only works in Twitch channels"));
return "";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is almost the same as in other twitch commands. In my opinion you should be able to do something like this:

this->registerTwitchCommand("/xd", 
                            [](const QStringList&,
                               std::shared_ptr<TwitchChannel>,
                               std::shared_ptr<TwitchAccount>) { 
// ...
});

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

There were too many comments to post at once. Showing the first 25 out of 48. Check the log or trigger a new build to see more.

src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.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/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
tests/src/HighlightController.cpp Show resolved Hide resolved
tests/src/HighlightController.cpp Show resolved Hide resolved
tests/src/HighlightController.cpp Show resolved Hide resolved
tests/src/HighlightController.cpp Show resolved Hide resolved
tests/src/HighlightController.cpp Show resolved Hide resolved
Copy link
Collaborator

@Felanbird Felanbird left a comment

Choose a reason for hiding this comment

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

nitpicks

src/providers/twitch/api/Helix.hpp Outdated Show resolved Hide resolved
src/providers/twitch/api/Helix.hpp Outdated Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Outdated Show resolved Hide resolved
src/controllers/commands/CommandController.cpp Outdated Show resolved Hide resolved
src/controllers/commands/CommandController.cpp Outdated 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/api/Helix.cpp Show resolved Hide resolved
@pajlada pajlada dismissed Felanbird’s stale review October 2, 2022 14:00

All changes made & approved by me

@pajlada pajlada added the hacktoberfest-accepted FarmingCommits label Oct 2, 2022
@pajlada pajlada enabled auto-merge (squash) October 2, 2022 14:01
@pajlada pajlada merged commit 54129f7 into Chatterino:master Oct 2, 2022
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/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
@Nerixyz Nerixyz deleted the refactor/migrate-chat-settings-1 branch October 2, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate /emoteonly command to Helix API
3 participants