refactor(eventsub): Respect "Hide moderation actions" explicitly (#6041)

This commit is contained in:
pajlada
2025-03-08 14:00:35 +01:00
committed by GitHub
parent 0835064375
commit 77c4d858f9
79 changed files with 153 additions and 125 deletions
+7 -8
View File
@@ -166,16 +166,14 @@ void MessageLayout::actuallyLayout(const MessageLayoutContext &ctx)
continue;
}
if (this->message_->flags.has(MessageFlag::Timeout) ||
this->message_->flags.has(MessageFlag::Untimeout))
if (this->message_->flags.has(MessageFlag::ModerationAction))
{
// NOTE: This hides the message but it will make the message re-appear if moderation message hiding is no longer active, and the layout is re-laid-out.
// This is only the case for the moderation messages that don't get filtered during creation.
// We should decide which is the correct method & apply that everywhere
if (hideModerationActions ||
(getSettings()->streamerModeHideModActions &&
getApp()->getStreamerMode()->isEnabled()))
getApp()->getStreamerMode()->shouldHideModActions())
{
// Message is being hidden because we consider the message
// a moderation action (something a streamer is unlikely to
// want to share if they briefly show their chat on stream)
continue;
}
}
@@ -515,7 +513,8 @@ bool MessageLayout::isReplyable() const
if (this->message_->flags.hasAny(
{MessageFlag::System, MessageFlag::Subscription,
MessageFlag::Timeout, MessageFlag::Whisper}))
MessageFlag::Timeout, MessageFlag::Whisper,
MessageFlag::ModerationAction}))
{
return false;
}