From bbf649bf7090efa89c4d3e943031b4214c05c58a Mon Sep 17 00:00:00 2001 From: TranRed Date: Wed, 1 May 2019 16:08:45 +0200 Subject: [PATCH] Added {message} parameter for moderation buttons --- src/widgets/helper/ChannelView.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index a1fdf645f..a8ee61b34 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1667,9 +1667,21 @@ 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); + + QString messageText; + if (value.contains("{message}")) + { + messageText = layout->getMessage()->searchText; + // remove name + : + space to only get the actual message text + messageText = messageText.remove( + 0, (layout->getMessage()->loginName.length() + 2)); + value.replace("{message}", messageText); + } + this->channel_->sendMessage(value); } break;