Move most Command variables into the CommandController shared variables (#3824)
This commit is contained in:
@@ -2125,20 +2125,12 @@ void ChannelView::addCommandExecutionContextMenuItems(
|
||||
{
|
||||
userText = split->getInput().getInputText();
|
||||
}
|
||||
|
||||
// Execute command through right-clicking a message -> Execute command
|
||||
QString value = getApp()->commands->execCustomCommand(
|
||||
inputText.split(' '), cmd, true, channel,
|
||||
inputText.split(' '), cmd, true, channel, layout->getMessage(),
|
||||
{
|
||||
{"user.name", layout->getMessage()->loginName},
|
||||
{"msg.id", layout->getMessage()->id},
|
||||
{"msg.text", layout->getMessage()->messageText},
|
||||
{"input.text", userText},
|
||||
|
||||
// old placeholders
|
||||
{"user", layout->getMessage()->loginName},
|
||||
{"msg-id", layout->getMessage()->id},
|
||||
{"message", layout->getMessage()->messageText},
|
||||
|
||||
{"channel", this->channel()->getName()},
|
||||
});
|
||||
|
||||
value = getApp()->commands->execCommand(value, channel, false);
|
||||
@@ -2283,21 +2275,10 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute command clicking a moderator button
|
||||
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()},
|
||||
});
|
||||
layout->getMessage());
|
||||
|
||||
value = getApp()->commands->execCommand(value, channel, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user