mirror-chatterino2/src/messages/Message.cpp

47 lines
1,011 B
C++
Raw Normal View History

2018-06-26 14:09:39 +02:00
#include "messages/Message.hpp"
#include "Application.hpp"
2018-06-26 14:09:39 +02:00
#include "MessageElement.hpp"
#include "providers/twitch/PubsubActions.hpp"
#include "singletons/Theme.hpp"
2018-08-07 01:35:24 +02:00
#include "util/DebugCount.hpp"
2018-06-26 14:09:39 +02:00
#include "util/IrcHelpers.hpp"
2018-06-26 17:06:17 +02:00
using SBHighlight = chatterino::ScrollbarHighlight;
2018-01-06 03:48:56 +01:00
2017-04-14 17:52:22 +02:00
namespace chatterino {
2018-08-07 01:35:24 +02:00
Message::Message()
: parseTime(QTime::currentTime())
2017-04-12 17:46:44 +02:00
{
2018-08-07 01:35:24 +02:00
DebugCount::increase("messages");
2017-04-12 17:46:44 +02:00
}
2017-01-07 20:43:55 +01:00
2018-08-07 01:35:24 +02:00
Message::~Message()
2017-04-12 17:46:44 +02:00
{
2018-08-07 01:35:24 +02:00
DebugCount::decrease("messages");
2017-04-12 17:46:44 +02:00
}
2017-01-07 20:43:55 +01:00
2018-01-06 03:48:56 +01:00
SBHighlight Message::getScrollBarHighlight() const
{
if (this->flags.has(MessageFlag::Highlighted) ||
this->flags.has(MessageFlag::HighlightedWhisper))
2018-10-21 13:43:02 +02:00
{
return SBHighlight(this->highlightColor);
2018-10-21 13:43:02 +02:00
}
else if (this->flags.has(MessageFlag::Subscription) &&
getSettings()->enableSubHighlight)
2018-10-21 13:43:02 +02:00
{
return SBHighlight(
ColorProvider::instance().color(ColorType::Subscription));
2018-01-06 03:48:56 +01:00
}
return SBHighlight();
}
// Static
namespace {
} // namespace
2017-04-14 17:52:22 +02:00
} // namespace chatterino