mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
5957551d06
* Support for user-defined sounds and colors * Make color & sound columns selectable * Add custom row for subscription highlights * Add subscriptions to custom highlights and centrally manage highlight colors * Dynamically update message highlight colors
47 lines
1,011 B
C++
47 lines
1,011 B
C++
#include "messages/Message.hpp"
|
|
|
|
#include "Application.hpp"
|
|
#include "MessageElement.hpp"
|
|
#include "providers/twitch/PubsubActions.hpp"
|
|
#include "singletons/Theme.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(this->highlightColor);
|
|
}
|
|
else if (this->flags.has(MessageFlag::Subscription) &&
|
|
getSettings()->enableSubHighlight)
|
|
{
|
|
return SBHighlight(
|
|
ColorProvider::instance().color(ColorType::Subscription));
|
|
}
|
|
return SBHighlight();
|
|
}
|
|
|
|
// Static
|
|
namespace {
|
|
|
|
} // namespace
|
|
|
|
} // namespace chatterino
|