From 0eaaaa060364c9481076b8f44572bab97e4bec8a Mon Sep 17 00:00:00 2001 From: Daniel Sage Date: Wed, 2 Nov 2022 18:00:46 -0400 Subject: [PATCH] Fix hiding reply text in reply popup --- src/messages/layouts/MessageLayout.cpp | 20 +++++++++----------- src/messages/layouts/MessageLayout.hpp | 2 -- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/messages/layouts/MessageLayout.cpp b/src/messages/layouts/MessageLayout.cpp index 07c2ddc0b12..65bbf36cad0 100644 --- a/src/messages/layouts/MessageLayout.cpp +++ b/src/messages/layouts/MessageLayout.cpp @@ -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 diff --git a/src/messages/layouts/MessageLayout.hpp b/src/messages/layouts/MessageLayout.hpp index 2de8ed9872d..a8fcf2290fa 100644 --- a/src/messages/layouts/MessageLayout.hpp +++ b/src/messages/layouts/MessageLayout.hpp @@ -65,7 +65,6 @@ class MessageLayout : boost::noncopyable // Misc bool isDisabled() const; bool isReplyable() const; - void setRenderReplies(bool render); private: // variables @@ -73,7 +72,6 @@ class MessageLayout : boost::noncopyable std::shared_ptr container_; std::shared_ptr buffer_{}; bool bufferValid_ = false; - bool renderReplies_ = true; int height_ = 0;