Skip to content

Commit

Permalink
treat each channelView with its filter as its own
Browse files Browse the repository at this point in the history
  • Loading branch information
hemirt committed Oct 26, 2024
1 parent 7844a3b commit 55c0e69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/widgets/helper/ChannelView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class ChannelView final : public BaseWidget
LimitedQueueSnapshot<MessageLayoutPtr> &getMessagesSnapshot();

// Returns true if message should be included
bool shouldIncludeMessage(const MessagePtr &m) const;
bool shouldIncludeMessage(const MessagePtr &message) const;

void queueLayout();
void invalidateBuffers();
Expand Down Expand Up @@ -216,6 +216,11 @@ class ChannelView final : public BaseWidget
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<QMouseEvent *> mouseDown;
Expand Down
7 changes: 3 additions & 4 deletions src/widgets/helper/NotebookTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/widgets/helper/NotebookTab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ class NotebookTab : public Button
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<ChannelView::ChannelViewID> newMessageSource;
std::unordered_set<ChannelView::ChannelViewID> highlightedSource;

Expand Down

0 comments on commit 55c0e69

Please sign in to comment.