Add new command placeholders: {channel.name}, {channel.id}, {stream.game}, {stream.title}, {my.id}, {my.name} (#3155)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -2101,12 +2101,24 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
|
||||
}
|
||||
}
|
||||
|
||||
value.replace("{user}", layout->getMessage()->loginName)
|
||||
.replace("{channel}", this->channel_->getName())
|
||||
.replace("{msg-id}", layout->getMessage()->id)
|
||||
.replace("{message}", layout->getMessage()->messageText);
|
||||
value = getApp()->commands->execCustomCommand(
|
||||
QStringList(), Command{"(modaction)", value}, true, channel,
|
||||
{
|
||||
{"user.name", layout->getMessage()->loginName},
|
||||
{"msg.id", layout->getMessage()->id},
|
||||
{"msg.text", layout->getMessage()->messageText},
|
||||
|
||||
// old placeholders
|
||||
{"user", layout->getMessage()->loginName},
|
||||
{"msg-id", layout->getMessage()->id},
|
||||
{"message", layout->getMessage()->messageText},
|
||||
|
||||
// new version of this is inside execCustomCommand
|
||||
{"channel", this->channel()->getName()},
|
||||
});
|
||||
|
||||
value = getApp()->commands->execCommand(value, channel, false);
|
||||
|
||||
channel->sendMessage(value);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user