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:
Mm2PL
2021-09-11 14:35:26 +02:00
committed by GitHub
parent c0f4a410fa
commit 9b9fd7d403
5 changed files with 117 additions and 15 deletions
+16 -4
View File
@@ -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;