From 82dd90f4684db4240311edc13bd3707772e0dbe8 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Tue, 22 Jul 2008 17:56:55 +0200 Subject: [PATCH] added and to predefined alias variables. (needs core restart) --- src/core/userinputhandler.cpp | 2 ++ src/qtui/settingspages/aliasesmodel.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/userinputhandler.cpp b/src/core/userinputhandler.cpp index b6a5c697..deddc925 100644 --- a/src/core/userinputhandler.cpp +++ b/src/core/userinputhandler.cpp @@ -360,6 +360,8 @@ void UserInputHandler::expand(const QString &alias, const BufferInfo &bufferInfo command = command.replace(QString("$%1").arg(j), params[j - 1]); } command = command.replace("$0", msg); + command = command.replace("$channelname", bufferInfo.bufferName()); + command = command.replace("$currentnick", network()->myNick()); handleUserInput(bufferInfo, command); } } diff --git a/src/qtui/settingspages/aliasesmodel.cpp b/src/qtui/settingspages/aliasesmodel.cpp index 8df22791..6504fae5 100644 --- a/src/qtui/settingspages/aliasesmodel.cpp +++ b/src/qtui/settingspages/aliasesmodel.cpp @@ -52,7 +52,11 @@ QVariant AliasesModel::data(const QModelIndex &index, int role) const { "Example: \"foo\" can be used per /foo"; case 1: return "The string the shortcut will be expanded to
" - "$i represenents the i'th parameter. $0 the whole string.
" + "special variables:
" + " - $i represenents the i'th parameter.
" + " - $0 the whole string.
" + " - $currentnick your current nickname
" + " - $channelname the name of the selected channel

" "Multiple commands can be separated with semicolons

" "Example: \"Test $1; Test $2; Test All $0\" will be expanded to three separate messages \"Test 1\", \"Test 2\" and \"Test All 1 2 3\" when called like /test 1 2 3"; default: -- 2.20.1