From: Svetlana Tkachenko Date: Mon, 8 Jan 2018 00:39:45 +0000 (+0000) Subject: Support $i:ident in aliases X-Git-Tag: travis-deploy-test~149 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=517fc0fdbbd67b4e195b7a06246ff81a963a37fa Support $i:ident in aliases https://bugs.quassel-irc.org/issues/1454 Implements #1454. --- diff --git a/src/common/aliasmanager.cpp b/src/common/aliasmanager.cpp index 3d049fad..e7cdec65 100644 --- a/src/common/aliasmanager.cpp +++ b/src/common/aliasmanager.cpp @@ -189,6 +189,7 @@ void AliasManager::expand(const QString &alias, const BufferInfo &bufferInfo, co for (int j = params.count(); j > 0; j--) { IrcUser *ircUser = net->ircUser(params[j - 1]); command = command.replace(QString("$%1:hostname").arg(j), ircUser ? ircUser->host() : QString("*")); + command = command.replace(QString("$%1:ident").arg(j), ircUser ? ircUser->user() : QString("*")); command = command.replace(QString("$%1").arg(j), params[j - 1]); } command = command.replace("$0", msg); diff --git a/src/qtui/settingspages/aliasesmodel.cpp b/src/qtui/settingspages/aliasesmodel.cpp index 39b475ab..99b03d26 100644 --- a/src/qtui/settingspages/aliasesmodel.cpp +++ b/src/qtui/settingspages/aliasesmodel.cpp @@ -64,6 +64,7 @@ QVariant AliasesModel::data(const QModelIndex &index, int role) const " - $i..j represents the i'th to j'th parameter separated by spaces.
" " - $i.. represents all parameters from i on separated by spaces.
" " - $i:hostname represents the hostname of the user identified by the i'th parameter or a * if unknown.
" + " - $i:ident represents the ident of the user identified by the i'th parameter or a * if unknown.
" " - $0 the whole string.
" " - $nick your current nickname
" " - $channel the name of the selected channel

"