-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
🛡 Add /shield
and /shieldoff
🛡
#4580
Conversation
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.
clang-tidy made some suggestions
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.
clang-tidy made some suggestions
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.
clang-tidy made some suggestions
#include "providers/twitch/TwitchAccount.hpp" | ||
#include "providers/twitch/TwitchChannel.hpp" | ||
|
||
namespace chatterino::commands { |
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.
warning: modification of 'std' namespace can result in undefined behavior [cert-dcl58-cpp]
namespace chatterino::commands {
^
Additional context
/usr/include/c++/11/bits/unique_ptr.h:44: 'std' namespace opened here
namespace std _GLIBCXX_VISIBILITY(default)
^
|
||
QString toggleShieldMode(const CommandContext &ctx, bool isActivating) | ||
{ | ||
const QString command = |
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.
warning: variable 'command' is not initialized [cppcoreguidelines-init-variables]
const QString command = | |
const QString command = 0 = |
}, | ||
[channel = ctx.channel](const auto error, const auto &message) { | ||
using Error = HelixUpdateShieldModeError; | ||
QString errorMessage = "Failed to update shield mode - "; |
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.
warning: variable 'errorMessage' is not initialized [cppcoreguidelines-init-variables]
QString errorMessage = "Failed to update shield mode - "; | |
QString errorMessage = 0 = "Failed to update shield mode - "; |
@@ -0,0 +1,16 @@ | |||
#pragma once | |||
|
|||
#include <QString> |
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.
warning: 'QString' file not found [clang-diagnostic-error]
#include <QString>
^
Description
This PR adds the
/shield
and/shieldoff
commands that toggle shield mode. Shield mode is not tracked internally. If shield mode is active and/shield
is used, there will be just be a message, saying "Shield mode was activated." (which is true - shield mode was activated in the past - even more: it hasn't been disabled since). There's little-to-no point in checking the shield mode before, because it might be changed between checking and updating. The only reason this should be done is to provide the user with the name of the moderator that enabled shield mode (this isn't sent if the mode didn't change for some reason).Closes #4206.