chore: remove dead code and get rid of MSVC warnings (#6024)
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
- Dev: BTTV emotes are now loaded as WEBP. (#5957)
|
||||
- Dev: Reduced time we wait for PubSub connections to cleanly exit from 1s to 100ms. (#6019)
|
||||
- Dev: Added snapshot tests for EventSub. (#5965)
|
||||
- Dev: Removed dead code and some MSVC warnings. (#6024)
|
||||
|
||||
## 2.5.2
|
||||
|
||||
|
||||
@@ -283,9 +283,9 @@ void Channel::replaceMessage(size_t hint, const MessagePtr &message,
|
||||
}
|
||||
}
|
||||
|
||||
void Channel::disableMessage(QString messageID)
|
||||
void Channel::disableMessage(const QString &messageID)
|
||||
{
|
||||
auto msg = this->findMessage(messageID);
|
||||
auto msg = this->findMessageByID(messageID);
|
||||
if (msg != nullptr)
|
||||
{
|
||||
msg->flags.set(MessageFlag::Disabled);
|
||||
@@ -298,11 +298,6 @@ void Channel::clearMessages()
|
||||
this->messagesCleared.invoke();
|
||||
}
|
||||
|
||||
MessagePtr Channel::findMessage(QString messageID)
|
||||
{
|
||||
return this->findMessageByID(messageID);
|
||||
}
|
||||
|
||||
MessagePtr Channel::findMessageByID(QStringView messageID)
|
||||
{
|
||||
MessagePtr res;
|
||||
|
||||
@@ -99,13 +99,11 @@ public:
|
||||
void replaceMessage(size_t index, const MessagePtr &replacement);
|
||||
void replaceMessage(size_t hint, const MessagePtr &message,
|
||||
const MessagePtr &replacement);
|
||||
void disableMessage(QString messageID);
|
||||
void disableMessage(const QString &messageID);
|
||||
|
||||
/// Removes all messages from this channel and invokes #messagesCleared
|
||||
void clearMessages();
|
||||
|
||||
[[deprecated("Use findMessageByID instead")]] MessagePtr findMessage(
|
||||
QString messageID);
|
||||
MessagePtr findMessageByID(QStringView messageID) final;
|
||||
|
||||
bool hasMessages() const;
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Channel.hpp"
|
||||
#include "common/network/NetworkResult.hpp"
|
||||
#include "controllers/accounts/AccountController.hpp"
|
||||
#include "controllers/commands/CommandContext.hpp"
|
||||
#include "messages/Message.hpp"
|
||||
#include "messages/MessageBuilder.hpp"
|
||||
#include "providers/twitch/api/Helix.hpp"
|
||||
#include "providers/twitch/TwitchAccount.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
|
||||
@@ -91,7 +89,7 @@ QString deleteOneMessage(const CommandContext &ctx)
|
||||
return "";
|
||||
}
|
||||
|
||||
auto msg = ctx.channel->findMessage(messageID);
|
||||
auto msg = ctx.channel->findMessageByID(messageID);
|
||||
if (msg != nullptr)
|
||||
{
|
||||
if (msg->loginName == ctx.channel->getName() &&
|
||||
|
||||
@@ -512,7 +512,7 @@ void IrcMessageHandler::handleClearMessageMessage(Communi::IrcMessage *message)
|
||||
|
||||
QString targetID = tags.value("target-msg-id").toString();
|
||||
|
||||
auto msg = chan->findMessage(targetID);
|
||||
auto msg = chan->findMessageByID(targetID);
|
||||
if (msg == nullptr)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -924,9 +924,9 @@ void UserInfoPopup::updateUserData()
|
||||
// get ignoreHighlights state
|
||||
bool isIgnoringHighlights = false;
|
||||
const auto &vector = getSettings()->blacklistedUsers.raw();
|
||||
for (const auto &user : vector)
|
||||
for (const auto &blockedUser : vector)
|
||||
{
|
||||
if (this->userName_ == user.getPattern())
|
||||
if (this->userName_ == blockedUser.getPattern())
|
||||
{
|
||||
isIgnoringHighlights = true;
|
||||
break;
|
||||
|
||||
@@ -372,36 +372,7 @@ QString SplitInput::handleSendMessage(const std::vector<QString> &arguments)
|
||||
auto *tc = dynamic_cast<TwitchChannel *>(c.get());
|
||||
if (!tc)
|
||||
{
|
||||
// Reply to message
|
||||
auto tc = dynamic_cast<TwitchChannel *>(c.get());
|
||||
if (!tc)
|
||||
{
|
||||
// this should not fail
|
||||
return "";
|
||||
}
|
||||
|
||||
QString message = this->ui_.textEdit->toPlainText();
|
||||
|
||||
if (this->enableInlineReplying_)
|
||||
{
|
||||
// Remove @username prefix that is inserted when doing inline replies
|
||||
message.remove(0, this->replyTarget_->displayName.length() +
|
||||
1); // remove "@username"
|
||||
|
||||
if (!message.isEmpty() && message.at(0) == ' ')
|
||||
{
|
||||
message.remove(0, 1); // remove possible space
|
||||
}
|
||||
}
|
||||
|
||||
message = message.replace('\n', ' ');
|
||||
QString sendMessage =
|
||||
getApp()->getCommands()->execCommand(message, c, false);
|
||||
|
||||
// Reply within TwitchChannel
|
||||
tc->sendReply(sendMessage, this->replyTarget_->id);
|
||||
|
||||
this->postMessageSend(message, arguments);
|
||||
// this should not fail
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user