mirror-chatterino2/src/messages/Message.cpp

42 lines
859 B
C++
Raw Normal View History

2018-06-26 14:09:39 +02:00
#include "messages/Message.hpp"
#include "MessageElement.hpp"
#include "providers/twitch/PubsubActions.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
{
2018-01-06 03:48:56 +01:00
return SBHighlight(SBHighlight::Highlight);
2018-10-21 13:43:02 +02:00
}
else if (this->flags.has(MessageFlag::Subscription))
{
2018-06-04 12:23:23 +02:00
return SBHighlight(SBHighlight::Subscription);
2018-01-06 03:48:56 +01:00
}
return SBHighlight();
}
// Static
namespace {
} // namespace
2017-04-14 17:52:22 +02:00
} // namespace chatterino