mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Added {message} parameter for moderation buttons
This commit is contained in:
parent
34f820be18
commit
bbf649bf70
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue