Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Reply Text Showing In Reply Thread Popup #4101

Merged
merged 2 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions src/messages/layouts/MessageLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
dnsge marked this conversation as resolved.
Show resolved Hide resolved

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;
Expand Down Expand Up @@ -455,9 +458,4 @@ bool MessageLayout::isReplyable() const
return true;
}

void MessageLayout::setRenderReplies(bool render)
{
this->renderReplies_ = render;
}

} // namespace chatterino
2 changes: 0 additions & 2 deletions src/messages/layouts/MessageLayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ class MessageLayout : boost::noncopyable
// Misc
bool isDisabled() const;
bool isReplyable() const;
void setRenderReplies(bool render);

private:
// variables
MessagePtr message_;
std::shared_ptr<MessageLayoutContainer> container_;
std::shared_ptr<QPixmap> buffer_{};
bool bufferValid_ = false;
bool renderReplies_ = true;

int height_ = 0;

Expand Down