feat: seperate watchstreak highlights from sub highlights (#6571)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -46,6 +46,7 @@ QSet<QColor> ColorProvider::recentColors() const
|
||||
// Insert preset highlight colors
|
||||
retVal.insert(*this->color(ColorType::SelfHighlight));
|
||||
retVal.insert(*this->color(ColorType::Subscription));
|
||||
retVal.insert(*this->color(ColorType::WatchStreak));
|
||||
retVal.insert(*this->color(ColorType::Whisper));
|
||||
|
||||
return retVal;
|
||||
@@ -110,6 +111,9 @@ void ColorProvider::initTypeColorMap()
|
||||
initColor(ColorType::Subscription, getSettings()->subHighlightColor,
|
||||
HighlightPhrase::FALLBACK_SUB_COLOR);
|
||||
|
||||
initColor(ColorType::WatchStreak, getSettings()->watchStreakHighlightColor,
|
||||
HighlightPhrase::FALLBACK_WATCH_STREAK_COLOR);
|
||||
|
||||
initColor(ColorType::Whisper, getSettings()->whisperHighlightColor,
|
||||
HighlightPhrase::FALLBACK_HIGHLIGHT_COLOR);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ enum class ColorType {
|
||||
Subscription,
|
||||
Whisper,
|
||||
RedeemedHighlight,
|
||||
WatchStreak,
|
||||
FirstMessageHighlight,
|
||||
ElevatedMessageHighlight,
|
||||
ThreadMessageHighlight,
|
||||
|
||||
@@ -720,7 +720,7 @@ void IrcMessageHandler::parseUserNoticeMessageInto(Communi::IrcMessage *message,
|
||||
if (!content.isEmpty())
|
||||
{
|
||||
addMessage(message, sink, channel, content, *getApp()->getTwitch(),
|
||||
true, false);
|
||||
true, false, msgType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +783,15 @@ void IrcMessageHandler::parseUserNoticeMessageInto(Communi::IrcMessage *message,
|
||||
parseTagString(messageText), tags,
|
||||
calculateMessageTime(message).time(), channel);
|
||||
|
||||
msg->flags.set(MessageFlag::Subscription);
|
||||
if (msgType == "viewermilestone")
|
||||
{
|
||||
msg->flags.set(MessageFlag::WatchStreak);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg->flags.set(MessageFlag::Subscription);
|
||||
}
|
||||
|
||||
if (mirrored)
|
||||
{
|
||||
msg->flags.set(MessageFlag::SharedMessage);
|
||||
@@ -852,7 +860,15 @@ void IrcMessageHandler::parseUserNoticeMessageInto(Communi::IrcMessage *message,
|
||||
parseTagString(messageText), login, displayName, userColor,
|
||||
calculateMessageTime(message).time());
|
||||
|
||||
msg->flags.set(MessageFlag::Subscription);
|
||||
if (msgType == "viewermilestone")
|
||||
{
|
||||
msg->flags.set(MessageFlag::WatchStreak);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg->flags.set(MessageFlag::Subscription);
|
||||
}
|
||||
|
||||
if (mirrored)
|
||||
{
|
||||
msg->flags.set(MessageFlag::SharedMessage);
|
||||
@@ -1014,7 +1030,7 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *message,
|
||||
MessageSink &sink, TwitchChannel *chan,
|
||||
const QString &originalContent,
|
||||
ITwitchIrcServer &twitch, bool isSub,
|
||||
bool isAction)
|
||||
bool isAction, const QString &msgType)
|
||||
{
|
||||
assert(chan);
|
||||
|
||||
@@ -1138,7 +1154,14 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *message,
|
||||
{
|
||||
if (isSub)
|
||||
{
|
||||
msg->flags.set(MessageFlag::Subscription);
|
||||
if (msgType == "viewermilestone")
|
||||
{
|
||||
msg->flags.set(MessageFlag::WatchStreak);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg->flags.set(MessageFlag::Subscription);
|
||||
}
|
||||
|
||||
if (tags.value("msg-id") != "announcement")
|
||||
{
|
||||
|
||||
@@ -61,7 +61,8 @@ public:
|
||||
|
||||
static void addMessage(Communi::IrcMessage *message, MessageSink &sink,
|
||||
TwitchChannel *chan, const QString &originalContent,
|
||||
ITwitchIrcServer &twitch, bool isSub, bool isAction);
|
||||
ITwitchIrcServer &twitch, bool isSub, bool isAction,
|
||||
const QString &msgType = "");
|
||||
|
||||
private:
|
||||
static float similarity(const MessagePtr &msg,
|
||||
|
||||
Reference in New Issue
Block a user