Fix: check reply-parent-user-id for blocked user (#4502)
This commit is contained in:
@@ -157,6 +157,17 @@ bool TwitchMessageBuilder::isIgnored() const
|
||||
});
|
||||
}
|
||||
|
||||
bool TwitchMessageBuilder::isIgnoredReply() const
|
||||
{
|
||||
return isIgnoredMessage({
|
||||
/*.message = */ this->originalMessage_,
|
||||
/*.twitchUserID = */
|
||||
this->tags.value("reply-parent-user-id").toString(),
|
||||
/*.isMod = */ this->channel->isMod(),
|
||||
/*.isBroadcaster = */ this->channel->isBroadcaster(),
|
||||
});
|
||||
}
|
||||
|
||||
void TwitchMessageBuilder::triggerHighlights()
|
||||
{
|
||||
if (this->historicalMessage_)
|
||||
@@ -622,19 +633,27 @@ void TwitchMessageBuilder::parseThread()
|
||||
if (replyDisplayName != this->tags.end() &&
|
||||
replyBody != this->tags.end())
|
||||
{
|
||||
auto name = replyDisplayName->toString();
|
||||
auto body = parseTagString(replyBody->toString());
|
||||
QString body;
|
||||
|
||||
this->emplace<ReplyCurveElement>();
|
||||
|
||||
this->emplace<TextElement>(
|
||||
"Replying to", MessageElementFlag::RepliedMessage,
|
||||
MessageColor::System, FontStyle::ChatMediumSmall);
|
||||
|
||||
this->emplace<TextElement>(
|
||||
"@" + name + ":", MessageElementFlag::RepliedMessage,
|
||||
this->textColor_, FontStyle::ChatMediumSmall)
|
||||
->setLink({Link::UserInfo, name});
|
||||
if (this->isIgnoredReply())
|
||||
{
|
||||
body = QString("[Blocked user]");
|
||||
}
|
||||
else
|
||||
{
|
||||
auto name = replyDisplayName->toString();
|
||||
body = parseTagString(replyBody->toString());
|
||||
|
||||
this->emplace<TextElement>(
|
||||
"@" + name + ":", MessageElementFlag::RepliedMessage,
|
||||
this->textColor_, FontStyle::ChatMediumSmall)
|
||||
->setLink({Link::UserInfo, name});
|
||||
}
|
||||
|
||||
this->emplace<SingleLineTextElement>(
|
||||
body,
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
TwitchChannel *twitchChannel;
|
||||
|
||||
[[nodiscard]] bool isIgnored() const override;
|
||||
bool isIgnoredReply() const;
|
||||
void triggerHighlights() override;
|
||||
MessagePtr build() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user