From: Marcus Eggenberger Date: Tue, 22 Jul 2008 15:56:55 +0000 (+0200) Subject: added and to predefined alias variables. (needs core restart) X-Git-Tag: 0.3.0~241 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=82dd90f4684db4240311edc13bd3707772e0dbe8;hp=f7eb3911860f30e6bccce3c77d03fc25e87d7f93 added and to predefined alias variables. (needs core restart) --- 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: