Fix Reply Text Showing In Reply Thread Popup (#4101)

This commit is contained in:
Daniel Sage 2022-11-02 19:20:37 -04:00 committed by GitHub
parent 1098be1286
commit 36402a2faf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View file

@ -134,30 +134,33 @@ void MessageLayout::actuallyLayout(int width, MessageElementFlags flags)
messageFlags.unset(MessageFlag::Collapsed);
}
bool hideModerated = getSettings()->hideModerated;
bool hideModerationActions = getSettings()->hideModerationActions;
bool hideSimilar = getSettings()->hideSimilar;
bool hideReplies = !flags.has(MessageElementFlag::RepliedMessage);
this->container_->begin(width, this->scale_, messageFlags);
for (const auto &element : this->message_->elements)
{
if (getSettings()->hideModerated &&
this->message_->flags.has(MessageFlag::Disabled))
if (hideModerated && this->message_->flags.has(MessageFlag::Disabled))
{
continue;
}
if (getSettings()->hideModerationActions &&
if (hideModerationActions &&
(this->message_->flags.has(MessageFlag::Timeout) ||
this->message_->flags.has(MessageFlag::Untimeout)))
{
continue;
}
if (getSettings()->hideSimilar &&
this->message_->flags.has(MessageFlag::Similar))
if (hideSimilar && this->message_->flags.has(MessageFlag::Similar))
{
continue;
}
if (!this->renderReplies_ &&
if (hideReplies &&
element->getFlags().has(MessageElementFlag::RepliedMessage))
{
continue;
@ -455,9 +458,4 @@ bool MessageLayout::isReplyable() const
return true;
}
void MessageLayout::setRenderReplies(bool render)
{
this->renderReplies_ = render;
}
} // namespace chatterino

View file

@ -65,7 +65,6 @@ public:
// Misc
bool isDisabled() const;
bool isReplyable() const;
void setRenderReplies(bool render);
private:
// variables
@ -73,7 +72,6 @@ private:
std::shared_ptr<MessageLayoutContainer> container_;
std::shared_ptr<QPixmap> buffer_{};
bool bufferValid_ = false;
bool renderReplies_ = true;
int height_ = 0;