diff --git a/src/messages/Message.hpp b/src/messages/Message.hpp index cdbb2a8d3..c187b5f55 100644 --- a/src/messages/Message.hpp +++ b/src/messages/Message.hpp @@ -48,6 +48,7 @@ struct Message : boost::noncopyable { QTime parseTime; QString id; QString searchText; + QString messageText; QString loginName; QString displayName; QString localizedName; diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index a029aea35..7b4c64ae8 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -97,6 +97,7 @@ MessageBuilder::MessageBuilder(const QString &text) this->emplace(); this->emplace(text, MessageElementFlag::Text, MessageColor::System); + this->message().messageText = text; this->message().searchText = text; } @@ -108,6 +109,7 @@ MessageBuilder::MessageBuilder(SystemMessageTag, const QString &text) MessageColor::System); this->message().flags.set(MessageFlag::System); this->message().flags.set(MessageFlag::DoNotTriggerNotification); + this->message().messageText = text; this->message().searchText = text; } @@ -158,6 +160,7 @@ MessageBuilder::MessageBuilder(TimeoutMessageTag, const QString &username, this->emplace(); this->emplace(text, MessageElementFlag::Text, MessageColor::System); + this->message().messageText = text; this->message().searchText = text; } @@ -214,6 +217,7 @@ MessageBuilder::MessageBuilder(const BanAction &action, uint32_t count) this->emplace(text, MessageElementFlag::Text, MessageColor::System); + this->message().messageText = text; this->message().searchText = text; } @@ -243,6 +247,7 @@ MessageBuilder::MessageBuilder(const UnbanAction &action) this->emplace(text, MessageElementFlag::Text, MessageColor::System); + this->message().messageText = text; this->message().searchText = text; } diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index b935a2831..8bccc6ea7 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -438,6 +438,7 @@ MessagePtr TwitchMessageBuilder::build() this->addWords(splits, twitchEmotes); + this->message().messageText = this->originalMessage_; this->message().searchText = this->userName + ": " + this->originalMessage_; return this->release(); diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index a1fdf645f..07c047eba 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1667,9 +1667,12 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link, case Link::UserAction: { QString value = link.value; + value.replace("{user}", layout->getMessage()->loginName) .replace("{channel}", this->channel_->getName()) - .replace("{msg-id}", layout->getMessage()->id); + .replace("{msg-id}", layout->getMessage()->id) + .replace("{message}", layout->getMessage()->messageText); + this->channel_->sendMessage(value); } break;