This commit is contained in:
Nerixyz 2024-11-01 18:18:15 +01:00
parent e537fca186
commit d91719b31e
No known key found for this signature in database
GPG key ID: 946BA188C5609CCC
5 changed files with 13 additions and 9 deletions

View file

@ -98,6 +98,7 @@ public:
/// Removes all messages from this channel and invokes #messagesCleared
void clearMessages();
[[deprecated("Use findMessageByID instead")]]
MessagePtr findMessage(QString messageID);
MessagePtr findMessageByID(QStringView messageID) final;

View file

@ -5,6 +5,7 @@
#include "messages/MessageFlag.hpp"
#include <memory>
#include <optional>
class QStringView;
class QTime;

View file

@ -369,8 +369,8 @@ void IrcMessageHandler::parsePrivMessageInto(
}
addMessage(message, sink, channel,
unescapeZeroWidthJoiner(message->content()), false,
message->isAction());
unescapeZeroWidthJoiner(message->content()),
*getApp()->getTwitch(), false, message->isAction());
if (message->tags().contains(u"pinned-chat-paid-amount"_s))
{
@ -675,7 +675,8 @@ void IrcMessageHandler::parseUserNoticeMessageInto(Communi::IrcMessage *message,
// Messages are not required, so they might be empty
if (!content.isEmpty())
{
addMessage(message, sink, channel, content, true, false);
addMessage(message, sink, channel, content, *getApp()->getTwitch(),
true, false);
}
}
@ -956,7 +957,8 @@ void IrcMessageHandler::handlePartMessage(Communi::IrcMessage *message)
void IrcMessageHandler::addMessage(Communi::IrcMessage *message,
MessageSink &sink, TwitchChannel *channel,
const QString &originalContent, bool isSub,
const QString &originalContent,
ITwitchIrcServer &twitch, bool isSub,
bool isAction)
{
assert(channel);
@ -1101,8 +1103,8 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *message,
if (highlighted && showInMentions &&
sink.sinkTraits().has(MessageSinkTrait::AddMentionsToGlobalChannel))
{
getApp()->getTwitch()->getMentionsChannel()->addMessage(
msg, MessageContext::Original);
twitch.getMentionsChannel()->addMessage(msg,
MessageContext::Original);
}
sink.addMessage(msg, MessageContext::Original);

View file

@ -61,8 +61,8 @@ public:
static void addMessage(Communi::IrcMessage *message, MessageSink &sink,
TwitchChannel *channel,
const QString &originalContent, bool isSub,
bool isAction);
const QString &originalContent,
ITwitchIrcServer &twitch, bool isSub, bool isAction);
private:
static float similarity(const MessagePtr &msg,

View file

@ -453,7 +453,7 @@ void TwitchChannel::addChannelPointReward(const ChannelPointReward &reward)
{
IrcMessageHandler::instance().addMessage(
msg.message.get(), *this, this, msg.originalContent,
false, false);
*server, false, false);
return true;
}
return false;