Merge pull request #998 from apa420/apa-remove-moderated-messages

Option to hide moderated messages (timed out messages)
This commit is contained in:
pajlada 2019-04-16 14:38:20 +02:00 committed by GitHub
commit 0737922915
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 0 deletions

View file

@ -127,6 +127,11 @@ void MessageLayout::actuallyLayout(int width, MessageElementFlags _flags)
for (const auto &element : this->message_->elements) for (const auto &element : this->message_->elements)
{ {
if (getSettings()->hideModerated &&
this->message_->flags.has(MessageFlag::Disabled))
{
continue;
}
element->addToContainer(*this->container_, _flags); element->addToContainer(*this->container_, _flags);
} }

View file

@ -261,6 +261,10 @@ void IrcMessageHandler::handleClearChatMessage(Communi::IrcMessage *message)
// refresh all // refresh all
app->windows->repaintVisibleChatWidgets(chan.get()); app->windows->repaintVisibleChatWidgets(chan.get());
if (getSettings()->hideModerated)
{
app->windows->forceLayoutChannelViews();
}
} }
void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message) void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message)

View file

@ -41,6 +41,7 @@ public:
BoolSetting separateMessages = {"/appearance/messages/separateMessages", BoolSetting separateMessages = {"/appearance/messages/separateMessages",
false}; false};
BoolSetting compactEmotes = {"/appearance/messages/compactEmotes", true}; BoolSetting compactEmotes = {"/appearance/messages/compactEmotes", true};
BoolSetting hideModerated = {"/appearance/messages/hideModerated", false};
// BoolSetting collapseLongMessages = // BoolSetting collapseLongMessages =
// {"/appearance/messages/collapseLongMessages", false}; // {"/appearance/messages/collapseLongMessages", false};

View file

@ -213,6 +213,7 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addCheckbox("Alternate background color", s.alternateMessages); layout.addCheckbox("Alternate background color", s.alternateMessages);
// layout.addCheckbox("Mark last message you read"); // layout.addCheckbox("Mark last message you read");
// layout.addDropdown("Last read message style", {"Default"}); // layout.addDropdown("Last read message style", {"Default"});
layout.addCheckbox("Hide moderated messages", s.hideModerated);
layout.addTitle("Emotes"); layout.addTitle("Emotes");
layout.addDropdown<float>( layout.addDropdown<float>(