diff --git a/src/messages/message.cpp b/src/messages/message.cpp index 8c8a4b43d..7049a4ce6 100644 --- a/src/messages/message.cpp +++ b/src/messages/message.cpp @@ -64,29 +64,12 @@ void Message::setId(const QString &_id) // Search const QString &Message::getSearchText() const { - // fourtf: asdf - // if (this->searchText.isNull()) { - // QString _content(""); + return this->searchText; +} - // bool first; - - // for (const MessageElement &word : this->words) { - // if (!first) { - // _content += ""; - // } - - // _content += word.getCopyText(); - // first = false; - // } - - // this->searchText = _content; - // } - - // return this->searchText; - - static QString xd; - - return xd; +void Message::setSearchText(const QString &value) +{ + this->searchText = value; } // Highlight @@ -106,6 +89,7 @@ MessagePtr Message::createSystemMessage(const QString &text) message->addElement(new TimestampElement(QTime::currentTime())); message->addElement(new TextElement(text, MessageElement::Text, MessageColor::System)); message->addFlags(Message::System); + message->setSearchText(text); return MessagePtr(message); } diff --git a/src/messages/message.hpp b/src/messages/message.hpp index 881b406f8..1fa4b3ea0 100644 --- a/src/messages/message.hpp +++ b/src/messages/message.hpp @@ -53,6 +53,7 @@ public: // Searching const QString &getSearchText() const; + void setSearchText(const QString &value); // Scrollbar widgets::ScrollbarHighlight getScrollBarHighlight() const; diff --git a/src/twitch/twitchmessagebuilder.cpp b/src/twitch/twitchmessagebuilder.cpp index 9a9d213b6..7c4dbac8b 100644 --- a/src/twitch/twitchmessagebuilder.cpp +++ b/src/twitch/twitchmessagebuilder.cpp @@ -188,6 +188,8 @@ MessagePtr TwitchMessageBuilder::parse() i++; } + this->message->setSearchText(this->userName + ": " + this->originalMessage); + return this->getMessage(); }