From 55c0e6980f468e52fe0e486b6bff67305c62ff61 Mon Sep 17 00:00:00 2001 From: unknown <1310440+hemirt@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:38:38 +0200 Subject: [PATCH] treat each channelView with its filter as its own --- src/widgets/helper/ChannelView.hpp | 7 ++++++- src/widgets/helper/NotebookTab.cpp | 7 +++---- src/widgets/helper/NotebookTab.hpp | 5 +++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/widgets/helper/ChannelView.hpp b/src/widgets/helper/ChannelView.hpp index 74fd0aa39..7c91d7234 100644 --- a/src/widgets/helper/ChannelView.hpp +++ b/src/widgets/helper/ChannelView.hpp @@ -180,7 +180,7 @@ public: LimitedQueueSnapshot &getMessagesSnapshot(); // Returns true if message should be included - bool shouldIncludeMessage(const MessagePtr &m) const; + bool shouldIncludeMessage(const MessagePtr &message) const; void queueLayout(); void invalidateBuffers(); @@ -216,6 +216,11 @@ public: Scrollbar *scrollbar(); using ChannelViewID = std::size_t; + /// + /// \brief Get the ID of this ChannelView + /// + /// The ID is made of the underlying channel's name + /// combined with the filter set IDs ChannelViewID getID() const; pajlada::Signals::Signal mouseDown; diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index 23d7d90bc..d3b2c2517 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -597,11 +597,10 @@ bool NotebookTab::shouldMessageHighlight(const ChannelView &channelViewSource, const auto &visibleSplits = visibleSplitContainer->getSplits(); for (const auto &visibleSplit : visibleSplits) { - if (channelViewSource.underlyingChannel() == - visibleSplit->getChannel() && + if (channelViewSource.getID() == + visibleSplit->getChannelView().getID() && visibleSplit->getChannelView().shouldIncludeMessage(message) && - channelViewSource.shouldIncludeMessage(message) && - channelViewSource.getFilterIds().empty()) + channelViewSource.shouldIncludeMessage(message)) { return false; } diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index 2d3865daa..28682eef6 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -126,6 +126,11 @@ private: const MessagePtr &message) const; struct HighlightSources { + // Source of the update to the highlight status is the split + // in which a message that causes the update appears. + // This message can be just a plain message causing the + // HighlightState::NewMessage state, or a message that pings the user + // causing the HighlightState::Highlighted state std::unordered_set newMessageSource; std::unordered_set highlightedSource;