From a83608156c3a561a0ba6d9625303040c02329550 Mon Sep 17 00:00:00 2001 From: Svetlana Tkachenko Date: Mon, 8 Jan 2018 04:44:17 +0000 Subject: [PATCH] Support $i:account in aliases Closes GH-321. --- src/common/aliasmanager.cpp | 1 + src/qtui/settingspages/aliasesmodel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/common/aliasmanager.cpp b/src/common/aliasmanager.cpp index e7cdec65..105a5954 100644 --- a/src/common/aliasmanager.cpp +++ b/src/common/aliasmanager.cpp @@ -190,6 +190,7 @@ void AliasManager::expand(const QString &alias, const BufferInfo &bufferInfo, co 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:account").arg(j), ircUser ? ircUser->account() : 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 99b03d26..3fab3834 100644 --- a/src/qtui/settingspages/aliasesmodel.cpp +++ b/src/qtui/settingspages/aliasesmodel.cpp @@ -65,6 +65,7 @@ QVariant AliasesModel::data(const QModelIndex &index, int role) const " - $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.
" + " - $i:account represents the account of the user identified by the i'th parameter or a * if logged out or unknown.
" " - $0 the whole string.
" " - $nick your current nickname
" " - $channel the name of the selected channel

" -- 2.20.1