mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
treat each channelView with its filter as its own
This commit is contained in:
parent
7844a3b91f
commit
55c0e6980f
3 changed files with 14 additions and 5 deletions
|
@ -180,7 +180,7 @@ public:
|
||||||
LimitedQueueSnapshot<MessageLayoutPtr> &getMessagesSnapshot();
|
LimitedQueueSnapshot<MessageLayoutPtr> &getMessagesSnapshot();
|
||||||
|
|
||||||
// Returns true if message should be included
|
// Returns true if message should be included
|
||||||
bool shouldIncludeMessage(const MessagePtr &m) const;
|
bool shouldIncludeMessage(const MessagePtr &message) const;
|
||||||
|
|
||||||
void queueLayout();
|
void queueLayout();
|
||||||
void invalidateBuffers();
|
void invalidateBuffers();
|
||||||
|
@ -216,6 +216,11 @@ public:
|
||||||
Scrollbar *scrollbar();
|
Scrollbar *scrollbar();
|
||||||
|
|
||||||
using ChannelViewID = std::size_t;
|
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;
|
ChannelViewID getID() const;
|
||||||
|
|
||||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||||
|
|
|
@ -597,11 +597,10 @@ bool NotebookTab::shouldMessageHighlight(const ChannelView &channelViewSource,
|
||||||
const auto &visibleSplits = visibleSplitContainer->getSplits();
|
const auto &visibleSplits = visibleSplitContainer->getSplits();
|
||||||
for (const auto &visibleSplit : visibleSplits)
|
for (const auto &visibleSplit : visibleSplits)
|
||||||
{
|
{
|
||||||
if (channelViewSource.underlyingChannel() ==
|
if (channelViewSource.getID() ==
|
||||||
visibleSplit->getChannel() &&
|
visibleSplit->getChannelView().getID() &&
|
||||||
visibleSplit->getChannelView().shouldIncludeMessage(message) &&
|
visibleSplit->getChannelView().shouldIncludeMessage(message) &&
|
||||||
channelViewSource.shouldIncludeMessage(message) &&
|
channelViewSource.shouldIncludeMessage(message))
|
||||||
channelViewSource.getFilterIds().empty())
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,11 @@ private:
|
||||||
const MessagePtr &message) const;
|
const MessagePtr &message) const;
|
||||||
|
|
||||||
struct HighlightSources {
|
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> newMessageSource;
|
||||||
std::unordered_set<ChannelView::ChannelViewID> highlightedSource;
|
std::unordered_set<ChannelView::ChannelViewID> highlightedSource;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue