From 0a3cc1deeddfb341c16d82db4f0b09c7040608c6 Mon Sep 17 00:00:00 2001 From: nerix Date: Wed, 22 Jan 2025 23:25:00 +0100 Subject: [PATCH] refactor: merge adjecent words into one `TextElement` (#5847) --- CHANGELOG.md | 1 + src/messages/MessageBuilder.cpp | 68 +++-- src/messages/MessageBuilder.hpp | 4 + src/messages/MessageColor.hpp | 6 + src/messages/MessageElement.cpp | 43 ++++ src/messages/MessageElement.hpp | 6 + .../IrcMessageHandler/all-usernames.json | 16 +- .../IrcMessageHandler/announcement.json | 32 +-- .../IrcMessageHandler/bad-emotes3.json | 16 +- .../IrcMessageHandler/bad-emotes4.json | 16 +- .../IrcMessageHandler/bitsbadge.json | 96 +------ tests/snapshots/IrcMessageHandler/cheer1.json | 16 +- tests/snapshots/IrcMessageHandler/cheer2.json | 32 +-- .../clearchat-stack-always.json | 16 +- .../clearchat-stack-no-user.json | 16 +- .../IrcMessageHandler/emoteonly-on.json | 96 +------ .../snapshots/IrcMessageHandler/emotes3.json | 16 +- .../snapshots/IrcMessageHandler/emotes4.json | 16 +- .../snapshots/IrcMessageHandler/emotes5.json | 16 +- .../IrcMessageHandler/highlight2.json | 32 +-- .../IrcMessageHandler/highlight3.json | 16 +- .../IrcMessageHandler/hype-chat0.json | 32 +-- .../IrcMessageHandler/hype-chat1.json | 192 +------------- .../IrcMessageHandler/hype-chat2.json | 192 +------------- .../IrcMessageHandler/ignore-infinite.json | 96 +------ .../IrcMessageHandler/ignore-replace.json | 112 +------- tests/snapshots/IrcMessageHandler/raid.json | 48 +--- .../IrcMessageHandler/reward-bits.json | 16 +- .../IrcMessageHandler/reward-known.json | 16 +- .../IrcMessageHandler/reward-unknown.json | 16 +- .../IrcMessageHandler/rm-deleted.json | 16 +- .../shared-chat-announcement.json | 96 +------ .../IrcMessageHandler/sub-first-gift.json | 224 +--------------- .../IrcMessageHandler/sub-first-time.json | 64 +---- .../snapshots/IrcMessageHandler/sub-gift.json | 80 +----- .../IrcMessageHandler/sub-message.json | 144 +---------- .../sub-multi-month-anon-gift.json | 176 +------------ .../sub-multi-month-gift-count.json | 240 ++---------------- .../sub-multi-month-gift.json | 128 +--------- .../sub-multi-month-resub.json | 224 +--------------- .../IrcMessageHandler/sub-multi-month.json | 128 +--------- .../IrcMessageHandler/sub-no-message.json | 192 +------------- 42 files changed, 289 insertions(+), 2719 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 644ed3fd107..df0d4a830bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Dev: Updated Conan dependencies. (#5776) - Dev: Replaced usage of `parseTime` with `serverReceivedTime` for clearchat messages. (#5824) - Dev: Support Boost 1.87. (#5832) +- Dev: Words from `TextElement`s are now combined where possible. (#5847) ## 2.5.2 diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index 4bdc15632ce..124220aeecd 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -526,8 +526,7 @@ MessageBuilder::MessageBuilder(SystemMessageTag, const QString &text, continue; } - this->emplace(word, MessageElementFlag::Text, - MessageColor::System); + this->appendOrEmplaceText(word, MessageColor::System); } this->message().flags.set(MessageFlag::System); this->message().flags.set(MessageFlag::DoNotTriggerNotification); @@ -552,8 +551,7 @@ MessagePtrMut MessageBuilder::makeSystemMessageWithUser( continue; } - builder.emplace(word, MessageElementFlag::Text, - MessageColor::System); + builder.appendOrEmplaceText(word, MessageColor::System); } builder->flags.set(MessageFlag::System); @@ -619,8 +617,7 @@ MessagePtrMut MessageBuilder::makeSubgiftMessage(const QString &text, continue; } - builder.emplace(word, MessageElementFlag::Text, - MessageColor::System); + builder.appendOrEmplaceText(word, MessageColor::System); } builder->flags.set(MessageFlag::System); @@ -743,18 +740,18 @@ MessageBuilder::MessageBuilder(const BanAction &action, uint32_t count) this->emplaceSystemTextAndUpdate("were", text); if (action.isBan()) { - this->emplaceSystemTextAndUpdate("banned", text); + this->appendOrEmplaceSystemTextAndUpdate("banned", text); } else { - this->emplaceSystemTextAndUpdate( + this->appendOrEmplaceSystemTextAndUpdate( QString("timed out for %1").arg(formatTime(action.duration)), text); } if (!action.source.login.isEmpty()) { - this->emplaceSystemTextAndUpdate("by", text); + this->appendOrEmplaceSystemTextAndUpdate("by", text); this->emplaceSystemTextAndUpdate( action.source.login + (action.reason.isEmpty() ? "." : ":"), text) @@ -763,7 +760,7 @@ MessageBuilder::MessageBuilder(const BanAction &action, uint32_t count) if (!action.reason.isEmpty()) { - this->emplaceSystemTextAndUpdate( + this->appendOrEmplaceSystemTextAndUpdate( QString("\"%1\".").arg(action.reason), text); } } @@ -812,7 +809,7 @@ MessageBuilder::MessageBuilder(const BanAction &action, uint32_t count) if (count > 1) { - this->emplaceSystemTextAndUpdate( + this->appendOrEmplaceSystemTextAndUpdate( QString("(%1 times)").arg(count), text); } } @@ -1226,6 +1223,42 @@ bool MessageBuilder::isIgnored(const QString &originalMessage, }); } +void MessageBuilder::appendOrEmplaceText(const QString &text, + MessageColor color) +{ + auto fallback = [&] { + this->emplace(text, MessageElementFlag::Text, color); + }; + if (this->message_->elements.empty()) + { + fallback(); + return; + } + + auto *back = + dynamic_cast(this->message_->elements.back().get()); + if (!back || // + dynamic_cast(back) || // + dynamic_cast(back) || // + !back->hasTrailingSpace() || // + back->getFlags() != MessageElementFlag::Text || // + back->color() != color) + { + fallback(); + return; + } + + back->appendText(text); +} + +void MessageBuilder::appendOrEmplaceSystemTextAndUpdate(const QString &text, + QString &toUpdate) +{ + toUpdate.append(text); + toUpdate.append(' '); + this->appendOrEmplaceText(text, MessageColor::System); +} + void MessageBuilder::triggerHighlights(const Channel *channel, const HighlightAlert &alert) { @@ -1759,22 +1792,19 @@ MessagePtr MessageBuilder::makeAutomodInfoMessage( QString info("Hey! Your message is being checked " "by mods and has not been sent."); text += info; - builder.emplace(info, MessageElementFlag::Text, - MessageColor::Text); + builder.appendOrEmplaceText(info, MessageColor::Text); } break; case AutomodInfoAction::Denied: { QString info("Mods have removed your message."); text += info; - builder.emplace(info, MessageElementFlag::Text, - MessageColor::Text); + builder.appendOrEmplaceText(info, MessageColor::Text); } break; case AutomodInfoAction::Approved: { QString info("Mods have accepted your message."); text += info; - builder.emplace(info, MessageElementFlag::Text, - MessageColor::Text); + builder.appendOrEmplaceText(info, MessageColor::Text); } break; } @@ -2019,7 +2049,7 @@ MessagePtrMut MessageBuilder::makeClearChatMessage(const QDateTime &now, if (count > 1) { - builder.emplaceSystemTextAndUpdate( + builder.appendOrEmplaceSystemTextAndUpdate( '(' % QString::number(count) % u" times)", messageText); } @@ -2332,7 +2362,7 @@ void MessageBuilder::addTextOrEmote(TextState &state, QString string) } } - this->emplace(string, MessageElementFlag::Text, textColor); + this->appendOrEmplaceText(string, textColor); } bool MessageBuilder::isEmpty() const diff --git a/src/messages/MessageBuilder.hpp b/src/messages/MessageBuilder.hpp index 4d0ffbfb843..0a5e43ad65d 100644 --- a/src/messages/MessageBuilder.hpp +++ b/src/messages/MessageBuilder.hpp @@ -168,6 +168,10 @@ class MessageBuilder return pointer; } + void appendOrEmplaceText(const QString &text, MessageColor color); + void appendOrEmplaceSystemTextAndUpdate(const QString &text, + QString &toUpdate); + static void triggerHighlights(const Channel *channel, const HighlightAlert &alert); diff --git a/src/messages/MessageColor.hpp b/src/messages/MessageColor.hpp index 8eb07d3504e..0e0665d7a18 100644 --- a/src/messages/MessageColor.hpp +++ b/src/messages/MessageColor.hpp @@ -17,6 +17,12 @@ struct MessageColor { QString toString() const; + bool operator==(const MessageColor &other) const noexcept + { + return this->type_ == other.type_ && + this->customColor_ == other.customColor_; + } + private: Type type_; QColor customColor_; diff --git a/src/messages/MessageElement.cpp b/src/messages/MessageElement.cpp index d61613b750f..09c6f94673e 100644 --- a/src/messages/MessageElement.cpp +++ b/src/messages/MessageElement.cpp @@ -674,6 +674,49 @@ void TextElement::addToContainer(MessageLayoutContainer &container, } } +const MessageColor &TextElement::color() const noexcept +{ + return this->color_; +} + +FontStyle TextElement::fontStyle() const noexcept +{ + return this->style_; +} + +void TextElement::appendText(QStringView text) +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + for (auto word : text.split(' ')) // creates a QList +#else + for (auto word : text.tokenize(u' ')) +#endif + { + this->words_.append(word.toString()); + } +} + +void TextElement::appendText(const QString &text) +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + this->appendText(QStringView{text}); +#else + qsizetype firstSpace = text.indexOf(u' '); + if (firstSpace == -1) + { + // reuse (ref) `text` + this->words_.emplace_back(text); + return; + } + + this->words_.emplace_back(text.sliced(0, firstSpace)); + for (auto word : QStringView{text}.sliced(firstSpace + 1).tokenize(u' ')) + { + this->words_.emplace_back(word.toString()); + } +#endif +} + QJsonObject TextElement::toJson() const { auto base = MessageElement::toJson(); diff --git a/src/messages/MessageElement.hpp b/src/messages/MessageElement.hpp index c19ed5c0c8a..a749839a84d 100644 --- a/src/messages/MessageElement.hpp +++ b/src/messages/MessageElement.hpp @@ -250,6 +250,12 @@ class TextElement : public MessageElement QJsonObject toJson() const override; + const MessageColor &color() const noexcept; + FontStyle fontStyle() const noexcept; + + void appendText(QStringView text); + void appendText(const QString &text); + protected: QStringList words_; diff --git a/tests/snapshots/IrcMessageHandler/all-usernames.json b/tests/snapshots/IrcMessageHandler/all-usernames.json index d74b64bd4d2..69111a1790a 100644 --- a/tests/snapshots/IrcMessageHandler/all-usernames.json +++ b/tests/snapshots/IrcMessageHandler/all-usernames.json @@ -178,21 +178,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "!" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "!", "UserColorKappa" ] }, diff --git a/tests/snapshots/IrcMessageHandler/announcement.json b/tests/snapshots/IrcMessageHandler/announcement.json index 06b21210c12..e43b209944d 100644 --- a/tests/snapshots/IrcMessageHandler/announcement.json +++ b/tests/snapshots/IrcMessageHandler/announcement.json @@ -132,36 +132,8 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "mm" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "test" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "mm", + "test", "lol" ] }, diff --git a/tests/snapshots/IrcMessageHandler/bad-emotes3.json b/tests/snapshots/IrcMessageHandler/bad-emotes3.json index aaefb0fcf2c..e0fa33d6fa3 100644 --- a/tests/snapshots/IrcMessageHandler/bad-emotes3.json +++ b/tests/snapshots/IrcMessageHandler/bad-emotes3.json @@ -89,21 +89,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "foo" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "foo", "bar" ] }, diff --git a/tests/snapshots/IrcMessageHandler/bad-emotes4.json b/tests/snapshots/IrcMessageHandler/bad-emotes4.json index e70385c6fa2..34d7c7b899a 100644 --- a/tests/snapshots/IrcMessageHandler/bad-emotes4.json +++ b/tests/snapshots/IrcMessageHandler/bad-emotes4.json @@ -89,21 +89,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "foo" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "foo", "bar" ] }, diff --git a/tests/snapshots/IrcMessageHandler/bitsbadge.json b/tests/snapshots/IrcMessageHandler/bitsbadge.json index 0ebbeb0ec4d..07029349940 100644 --- a/tests/snapshots/IrcMessageHandler/bitsbadge.json +++ b/tests/snapshots/IrcMessageHandler/bitsbadge.json @@ -67,96 +67,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "just" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "earned" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "new" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1K" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Bits" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "just", + "earned", + "a", + "new", + "1K", + "Bits", "badge!" ] } diff --git a/tests/snapshots/IrcMessageHandler/cheer1.json b/tests/snapshots/IrcMessageHandler/cheer1.json index d85bf884418..2b013c0aa53 100644 --- a/tests/snapshots/IrcMessageHandler/cheer1.json +++ b/tests/snapshots/IrcMessageHandler/cheer1.json @@ -550,21 +550,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "b" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "b", "c" ] }, diff --git a/tests/snapshots/IrcMessageHandler/cheer2.json b/tests/snapshots/IrcMessageHandler/cheer2.json index 779645fbcce..b8ffa05948a 100644 --- a/tests/snapshots/IrcMessageHandler/cheer2.json +++ b/tests/snapshots/IrcMessageHandler/cheer2.json @@ -195,36 +195,8 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "a" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "b" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "a", + "b", "c" ] }, diff --git a/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json b/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json index 702588c53ca..5ce16787445 100644 --- a/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json +++ b/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json @@ -55,21 +55,7 @@ "cleared", "by", "a", - "moderator." - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "moderator.", "(4", "times)" ] diff --git a/tests/snapshots/IrcMessageHandler/clearchat-stack-no-user.json b/tests/snapshots/IrcMessageHandler/clearchat-stack-no-user.json index 75ae006b1ab..5030714d716 100644 --- a/tests/snapshots/IrcMessageHandler/clearchat-stack-no-user.json +++ b/tests/snapshots/IrcMessageHandler/clearchat-stack-no-user.json @@ -55,21 +55,7 @@ "cleared", "by", "a", - "moderator." - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "moderator.", "(2", "times)" ] diff --git a/tests/snapshots/IrcMessageHandler/emoteonly-on.json b/tests/snapshots/IrcMessageHandler/emoteonly-on.json index d3e0c49808b..ef971b5fd40 100644 --- a/tests/snapshots/IrcMessageHandler/emoteonly-on.json +++ b/tests/snapshots/IrcMessageHandler/emoteonly-on.json @@ -49,96 +49,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "This" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "room" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "is" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "now" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "in" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "emote-only" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "This", + "room", + "is", + "now", + "in", + "emote-only", "mode." ] } diff --git a/tests/snapshots/IrcMessageHandler/emotes3.json b/tests/snapshots/IrcMessageHandler/emotes3.json index 9249074b9ab..8a4fcb42607 100644 --- a/tests/snapshots/IrcMessageHandler/emotes3.json +++ b/tests/snapshots/IrcMessageHandler/emotes3.json @@ -238,21 +238,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "a" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "a", "b" ] }, diff --git a/tests/snapshots/IrcMessageHandler/emotes4.json b/tests/snapshots/IrcMessageHandler/emotes4.json index bf50ec23c7b..1bc17a22505 100644 --- a/tests/snapshots/IrcMessageHandler/emotes4.json +++ b/tests/snapshots/IrcMessageHandler/emotes4.json @@ -123,21 +123,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "oo" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "oo", "bar" ] }, diff --git a/tests/snapshots/IrcMessageHandler/emotes5.json b/tests/snapshots/IrcMessageHandler/emotes5.json index 3b2e01b74a2..9f4dd123b15 100644 --- a/tests/snapshots/IrcMessageHandler/emotes5.json +++ b/tests/snapshots/IrcMessageHandler/emotes5.json @@ -123,21 +123,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "o" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "o", "bar" ] }, diff --git a/tests/snapshots/IrcMessageHandler/highlight2.json b/tests/snapshots/IrcMessageHandler/highlight2.json index aff7ba1d451..851297983cc 100644 --- a/tests/snapshots/IrcMessageHandler/highlight2.json +++ b/tests/snapshots/IrcMessageHandler/highlight2.json @@ -91,36 +91,8 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "something" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "my-highlight" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "something", + "my-highlight", "*" ] }, diff --git a/tests/snapshots/IrcMessageHandler/highlight3.json b/tests/snapshots/IrcMessageHandler/highlight3.json index f60774fc974..d3d54c83be0 100644 --- a/tests/snapshots/IrcMessageHandler/highlight3.json +++ b/tests/snapshots/IrcMessageHandler/highlight3.json @@ -91,21 +91,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "foo" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "foo", "no-mention-highlight" ] }, diff --git a/tests/snapshots/IrcMessageHandler/hype-chat0.json b/tests/snapshots/IrcMessageHandler/hype-chat0.json index f22bd0e0f97..54826a55c0a 100644 --- a/tests/snapshots/IrcMessageHandler/hype-chat0.json +++ b/tests/snapshots/IrcMessageHandler/hype-chat0.json @@ -206,36 +206,8 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "Hype" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Chat" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "Hype", + "Chat", "USD5.00" ] } diff --git a/tests/snapshots/IrcMessageHandler/hype-chat1.json b/tests/snapshots/IrcMessageHandler/hype-chat1.json index 2d709c606f8..fc6ed379a5d 100644 --- a/tests/snapshots/IrcMessageHandler/hype-chat1.json +++ b/tests/snapshots/IrcMessageHandler/hype-chat1.json @@ -133,111 +133,13 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "Title:" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Beating" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "the" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "record." - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "but" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "who" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "is" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "Title:", + "Beating", + "the", + "record.", + "but", + "who", + "is", "recordingLOL" ] }, @@ -313,81 +215,11 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "Level" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Hype" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Chat" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "(30s)" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "Level", + "1", + "Hype", + "Chat", + "(30s)", "NOK14.00" ] } diff --git a/tests/snapshots/IrcMessageHandler/hype-chat2.json b/tests/snapshots/IrcMessageHandler/hype-chat2.json index 20d8b872da8..56451b30c37 100644 --- a/tests/snapshots/IrcMessageHandler/hype-chat2.json +++ b/tests/snapshots/IrcMessageHandler/hype-chat2.json @@ -131,96 +131,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "forsen" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "please" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "read" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "my" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "super" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "chat." - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "forsen", + "please", + "read", + "my", + "super", + "chat.", "Please." ] }, @@ -296,96 +212,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "Level" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "2" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Hype" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Chat" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "(2m" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "30s)" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "Level", + "2", + "Hype", + "Chat", + "(2m", + "30s)", "USD5.00" ] } diff --git a/tests/snapshots/IrcMessageHandler/ignore-infinite.json b/tests/snapshots/IrcMessageHandler/ignore-infinite.json index 28030cafa7f..a86b7a7000d 100644 --- a/tests/snapshots/IrcMessageHandler/ignore-infinite.json +++ b/tests/snapshots/IrcMessageHandler/ignore-infinite.json @@ -91,96 +91,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "Too" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "many" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "replacements" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "-" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "check" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "your" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "Too", + "many", + "replacements", + "-", + "check", + "your", "ignores!" ] }, diff --git a/tests/snapshots/IrcMessageHandler/ignore-replace.json b/tests/snapshots/IrcMessageHandler/ignore-replace.json index 23f92df754e..8035984d977 100644 --- a/tests/snapshots/IrcMessageHandler/ignore-replace.json +++ b/tests/snapshots/IrcMessageHandler/ignore-replace.json @@ -223,96 +223,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "&baz2[1+\\2]" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "&baz3[1+\\42]" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "&bi1" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "&biii1" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "&baz4[i+420+i]" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "&baz1[oo+123]&baz1[o+2]" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "&baz2[1+\\2]", + "&baz3[1+\\42]", + "&bi1", + "&biii1", + "&baz4[i+420+i]", + "&baz1[oo+123]&baz1[o+2]", "{" ] }, @@ -362,21 +278,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "}" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "}", "woah->" ] }, diff --git a/tests/snapshots/IrcMessageHandler/raid.json b/tests/snapshots/IrcMessageHandler/raid.json index 1e4e84d428d..06bffb9028a 100644 --- a/tests/snapshots/IrcMessageHandler/raid.json +++ b/tests/snapshots/IrcMessageHandler/raid.json @@ -49,36 +49,8 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "2" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "raiders" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "2", + "raiders", "from" ] }, @@ -112,21 +84,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "have" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "have", "joined!" ] } diff --git a/tests/snapshots/IrcMessageHandler/reward-bits.json b/tests/snapshots/IrcMessageHandler/reward-bits.json index 8ad2e447d31..44255bbd0f8 100644 --- a/tests/snapshots/IrcMessageHandler/reward-bits.json +++ b/tests/snapshots/IrcMessageHandler/reward-bits.json @@ -239,21 +239,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "reward" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "reward", "1" ] }, diff --git a/tests/snapshots/IrcMessageHandler/reward-known.json b/tests/snapshots/IrcMessageHandler/reward-known.json index 1be46d8cf2b..d33493b7afc 100644 --- a/tests/snapshots/IrcMessageHandler/reward-known.json +++ b/tests/snapshots/IrcMessageHandler/reward-known.json @@ -185,21 +185,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "reward" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "reward", "1" ] }, diff --git a/tests/snapshots/IrcMessageHandler/reward-unknown.json b/tests/snapshots/IrcMessageHandler/reward-unknown.json index d614dd1fa3c..4b939592ca3 100644 --- a/tests/snapshots/IrcMessageHandler/reward-unknown.json +++ b/tests/snapshots/IrcMessageHandler/reward-unknown.json @@ -91,21 +91,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "reward" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "reward", "2" ] }, diff --git a/tests/snapshots/IrcMessageHandler/rm-deleted.json b/tests/snapshots/IrcMessageHandler/rm-deleted.json index 343dee79270..709df7d5161 100644 --- a/tests/snapshots/IrcMessageHandler/rm-deleted.json +++ b/tests/snapshots/IrcMessageHandler/rm-deleted.json @@ -160,21 +160,7 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "my7TVEmote" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "my7TVEmote", "hi" ] }, diff --git a/tests/snapshots/IrcMessageHandler/shared-chat-announcement.json b/tests/snapshots/IrcMessageHandler/shared-chat-announcement.json index f612fd720b5..ac87a64dd5e 100644 --- a/tests/snapshots/IrcMessageHandler/shared-chat-announcement.json +++ b/tests/snapshots/IrcMessageHandler/shared-chat-announcement.json @@ -148,96 +148,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "hi" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "this" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "is" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "an" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "announcement" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "from" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "hi", + "this", + "is", + "an", + "announcement", + "from", "1" ] }, diff --git a/tests/snapshots/IrcMessageHandler/sub-first-gift.json b/tests/snapshots/IrcMessageHandler/sub-first-gift.json index 9ad6339fae6..c710f97c05a 100644 --- a/tests/snapshots/IrcMessageHandler/sub-first-gift.json +++ b/tests/snapshots/IrcMessageHandler/sub-first-gift.json @@ -67,81 +67,11 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "gifted" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "sub" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "gifted", + "a", + "Tier", + "1", + "sub", "to" ] }, @@ -175,141 +105,15 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "!" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "This" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "is" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "their" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "first" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Gift" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Sub" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "in" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "the" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "!", + "This", + "is", + "their", + "first", + "Gift", + "Sub", + "in", + "the", "channel!" ] } diff --git a/tests/snapshots/IrcMessageHandler/sub-first-time.json b/tests/snapshots/IrcMessageHandler/sub-first-time.json index 8fd22c06a98..0963358c6a8 100644 --- a/tests/snapshots/IrcMessageHandler/sub-first-time.json +++ b/tests/snapshots/IrcMessageHandler/sub-first-time.json @@ -67,66 +67,10 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "just" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "subscribed" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "with" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Twitch" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "just", + "subscribed", + "with", + "Twitch", "Prime!" ] } diff --git a/tests/snapshots/IrcMessageHandler/sub-gift.json b/tests/snapshots/IrcMessageHandler/sub-gift.json index f7c77da850e..5da4a4c391c 100644 --- a/tests/snapshots/IrcMessageHandler/sub-gift.json +++ b/tests/snapshots/IrcMessageHandler/sub-gift.json @@ -67,81 +67,11 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "gifted" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "sub" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "gifted", + "a", + "Tier", + "1", + "sub", "to" ] }, diff --git a/tests/snapshots/IrcMessageHandler/sub-message.json b/tests/snapshots/IrcMessageHandler/sub-message.json index 8afca027299..f50de6e0da1 100644 --- a/tests/snapshots/IrcMessageHandler/sub-message.json +++ b/tests/snapshots/IrcMessageHandler/sub-message.json @@ -150,81 +150,11 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "Great" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "stream" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "--" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "keep" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "it" - ] - }, - { - "color": "Text", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "Great", + "stream", + "--", + "keep", + "it", "up!" ] }, @@ -319,66 +249,10 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "has" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "subscribed" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "for" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "6" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "has", + "subscribed", + "for", + "6", "months!" ] } diff --git a/tests/snapshots/IrcMessageHandler/sub-multi-month-anon-gift.json b/tests/snapshots/IrcMessageHandler/sub-multi-month-anon-gift.json index 02fd37398f7..46cd54bac3a 100644 --- a/tests/snapshots/IrcMessageHandler/sub-multi-month-anon-gift.json +++ b/tests/snapshots/IrcMessageHandler/sub-multi-month-anon-gift.json @@ -49,171 +49,17 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "An" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "anonymous" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "user" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "gifted" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "6" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "of" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "sub" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "An", + "anonymous", + "user", + "gifted", + "6", + "months", + "of", + "a", + "Tier", + "1", + "sub", "to" ] }, diff --git a/tests/snapshots/IrcMessageHandler/sub-multi-month-gift-count.json b/tests/snapshots/IrcMessageHandler/sub-multi-month-gift-count.json index 030f2984551..694f1c561c2 100644 --- a/tests/snapshots/IrcMessageHandler/sub-multi-month-gift-count.json +++ b/tests/snapshots/IrcMessageHandler/sub-multi-month-gift-count.json @@ -67,126 +67,14 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "gifted" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "6" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "of" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "sub" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "gifted", + "6", + "months", + "of", + "a", + "Tier", + "1", + "sub", "to" ] }, @@ -220,111 +108,13 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "!" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "They've" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "gifted" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "334" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "in" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "the" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "!", + "They've", + "gifted", + "334", + "months", + "in", + "the", "channel." ] } diff --git a/tests/snapshots/IrcMessageHandler/sub-multi-month-gift.json b/tests/snapshots/IrcMessageHandler/sub-multi-month-gift.json index 94eead08810..928dcddeee9 100644 --- a/tests/snapshots/IrcMessageHandler/sub-multi-month-gift.json +++ b/tests/snapshots/IrcMessageHandler/sub-multi-month-gift.json @@ -67,126 +67,14 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "gifted" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "12" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "of" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "sub" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "gifted", + "12", + "months", + "of", + "a", + "Tier", + "1", + "sub", "to" ] }, diff --git a/tests/snapshots/IrcMessageHandler/sub-multi-month-resub.json b/tests/snapshots/IrcMessageHandler/sub-multi-month-resub.json index ffa926d54a5..d1ac38e27e5 100644 --- a/tests/snapshots/IrcMessageHandler/sub-multi-month-resub.json +++ b/tests/snapshots/IrcMessageHandler/sub-multi-month-resub.json @@ -67,216 +67,20 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "subscribed" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "at" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "3" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "for" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "6" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "in" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "advance," - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "reaching" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "9" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "cumulatively" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "so" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "subscribed", + "at", + "Tier", + "3", + "for", + "6", + "months", + "in", + "advance,", + "reaching", + "9", + "months", + "cumulatively", + "so", "far!" ] } diff --git a/tests/snapshots/IrcMessageHandler/sub-multi-month.json b/tests/snapshots/IrcMessageHandler/sub-multi-month.json index 4adf9f17ae3..08384852e48 100644 --- a/tests/snapshots/IrcMessageHandler/sub-multi-month.json +++ b/tests/snapshots/IrcMessageHandler/sub-multi-month.json @@ -67,126 +67,14 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "subscribed" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "at" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "1" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "for" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "6" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "in" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "subscribed", + "at", + "Tier", + "1", + "for", + "6", + "months", + "in", "advance!" ] } diff --git a/tests/snapshots/IrcMessageHandler/sub-no-message.json b/tests/snapshots/IrcMessageHandler/sub-no-message.json index 7b866c3aea9..26596e8d560 100644 --- a/tests/snapshots/IrcMessageHandler/sub-no-message.json +++ b/tests/snapshots/IrcMessageHandler/sub-no-message.json @@ -67,96 +67,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "just" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "subscribed" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "with" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "Tier" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "2" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "just", + "subscribed", + "with", + "a", + "Tier", + "2", "sub." ] }, @@ -190,96 +106,12 @@ "trailingSpace": true, "type": "TextElement", "words": [ - "subscribed" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "for" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "12" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "months" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "in" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ - "a" - ] - }, - { - "color": "System", - "flags": "Text", - "link": { - "type": "None", - "value": "" - }, - "style": "ChatMedium", - "tooltip": "", - "trailingSpace": true, - "type": "TextElement", - "words": [ + "subscribed", + "for", + "12", + "months", + "in", + "a", "row!" ] }