mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
* Helix: Remove static from anon namespace * Message: Remove empty anon namespace * Message: Remove else after return * Message: Avoid repeating type in return * Message: Remove ScrollbarHighlight alias * Message: Remove unused includes * AttachedWindow: Remove unused include
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
#include "messages/Message.hpp"
|
|
|
|
#include "providers/colors/ColorProvider.hpp"
|
|
#include "providers/twitch/TwitchBadge.hpp"
|
|
#include "singletons/Settings.hpp"
|
|
#include "util/DebugCount.hpp"
|
|
#include "widgets/helper/ScrollbarHighlight.hpp"
|
|
|
|
namespace chatterino {
|
|
|
|
Message::Message()
|
|
: parseTime(QTime::currentTime())
|
|
{
|
|
DebugCount::increase("messages");
|
|
}
|
|
|
|
Message::~Message()
|
|
{
|
|
DebugCount::decrease("messages");
|
|
}
|
|
|
|
ScrollbarHighlight Message::getScrollBarHighlight() const
|
|
{
|
|
if (this->flags.has(MessageFlag::Highlighted) ||
|
|
this->flags.has(MessageFlag::HighlightedWhisper))
|
|
{
|
|
return {
|
|
this->highlightColor,
|
|
};
|
|
}
|
|
|
|
if (this->flags.has(MessageFlag::Subscription) &&
|
|
getSettings()->enableSubHighlight)
|
|
{
|
|
return {
|
|
ColorProvider::instance().color(ColorType::Subscription),
|
|
};
|
|
}
|
|
|
|
if (this->flags.has(MessageFlag::RedeemedHighlight) ||
|
|
this->flags.has(MessageFlag::RedeemedChannelPointReward))
|
|
{
|
|
return {
|
|
ColorProvider::instance().color(ColorType::RedeemedHighlight),
|
|
ScrollbarHighlight::Default,
|
|
true,
|
|
};
|
|
}
|
|
|
|
if (this->flags.has(MessageFlag::ElevatedMessage))
|
|
{
|
|
return {
|
|
ColorProvider::instance().color(
|
|
ColorType::ElevatedMessageHighlight),
|
|
ScrollbarHighlight::Default,
|
|
false,
|
|
false,
|
|
true,
|
|
};
|
|
}
|
|
|
|
if (this->flags.has(MessageFlag::FirstMessage))
|
|
{
|
|
return {
|
|
ColorProvider::instance().color(ColorType::FirstMessageHighlight),
|
|
ScrollbarHighlight::Default,
|
|
false,
|
|
true,
|
|
};
|
|
}
|
|
|
|
return {};
|
|
}
|
|
|
|
} // namespace chatterino
|