mirror-chatterino2/src/messages/Message.cpp
TranRed d725155569 Added setting and functionality to highlight inline whispers
Inline whispers will be displayed with highlighted background color.

New Flag needed to differentiate between normal whisper (highlighted) and whisper with mention.
2019-07-14 16:35:32 +02:00

42 lines
859 B
C++

#include "messages/Message.hpp"
#include "MessageElement.hpp"
#include "providers/twitch/PubsubActions.hpp"
#include "util/DebugCount.hpp"
#include "util/IrcHelpers.hpp"
using SBHighlight = chatterino::ScrollbarHighlight;
namespace chatterino {
Message::Message()
: parseTime(QTime::currentTime())
{
DebugCount::increase("messages");
}
Message::~Message()
{
DebugCount::decrease("messages");
}
SBHighlight Message::getScrollBarHighlight() const
{
if (this->flags.has(MessageFlag::Highlighted) ||
this->flags.has(MessageFlag::HighlightedWhisper))
{
return SBHighlight(SBHighlight::Highlight);
}
else if (this->flags.has(MessageFlag::Subscription))
{
return SBHighlight(SBHighlight::Subscription);
}
return SBHighlight();
}
// Static
namespace {
} // namespace
} // namespace chatterino