1 #include "messages/Message.hpp" 2 3 #include "Application.hpp" 4 #include "MessageElement.hpp" 5 #include "providers/twitch/PubsubActions.hpp" 6 #include "singletons/Theme.hpp" 7 #include "util/DebugCount.hpp" 8 #include "util/IrcHelpers.hpp" 9 10 using SBHighlight = chatterino::ScrollbarHighlight; 11 12 namespace chatterino { 13 Message()14Message::Message() 15 : parseTime(QTime::currentTime()) 16 { 17 DebugCount::increase("messages"); 18 } 19 ~Message()20Message::~Message() 21 { 22 DebugCount::decrease("messages"); 23 } 24 getScrollBarHighlight() const25SBHighlight Message::getScrollBarHighlight() const 26 { 27 if (this->flags.has(MessageFlag::Highlighted) || 28 this->flags.has(MessageFlag::HighlightedWhisper)) 29 { 30 return SBHighlight(this->highlightColor); 31 } 32 else if (this->flags.has(MessageFlag::Subscription) && 33 getSettings()->enableSubHighlight) 34 { 35 return SBHighlight( 36 ColorProvider::instance().color(ColorType::Subscription)); 37 } 38 else if (this->flags.has(MessageFlag::RedeemedHighlight) || 39 this->flags.has(MessageFlag::RedeemedChannelPointReward)) 40 { 41 return SBHighlight( 42 ColorProvider::instance().color(ColorType::RedeemedHighlight), 43 SBHighlight::Default, true); 44 } 45 return SBHighlight(); 46 } 47 48 // Static 49 namespace { 50 51 } // namespace 52 53 } // namespace chatterino 54