Support $i:account in aliases
authorSvetlana Tkachenko <svetlana@members.fsf.org>
Mon, 8 Jan 2018 04:44:17 +0000 (04:44 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Mar 2018 21:29:56 +0000 (23:29 +0200)
Closes GH-321.

src/common/aliasmanager.cpp
src/qtui/settingspages/aliasesmodel.cpp

index e7cdec6..105a595 100644 (file)
@@ -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("*"));
             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);
             command = command.replace(QString("$%1").arg(j), params[j - 1]);
         }
         command = command.replace("$0", msg);
index 99b03d2..3fab383 100644 (file)
@@ -65,6 +65,7 @@ QVariant AliasesModel::data(const QModelIndex &index, int role) const
                       " - <b>$i..</b> represents all parameters from i on separated by spaces.<br />"
                       " - <b>$i:hostname</b> represents the hostname of the user identified by the i'th parameter or a * if unknown.<br />"
                       " - <b>$i:ident</b> represents the ident of the user identified by the i'th parameter or a * if unknown.<br />"
                       " - <b>$i..</b> represents all parameters from i on separated by spaces.<br />"
                       " - <b>$i:hostname</b> represents the hostname of the user identified by the i'th parameter or a * if unknown.<br />"
                       " - <b>$i:ident</b> represents the ident of the user identified by the i'th parameter or a * if unknown.<br />"
+                      " - <b>$i:account</b> represents the account of the user identified by the i'th parameter or a * if logged out or unknown.<br />"
                       " - <b>$0</b> the whole string.<br />"
                       " - <b>$nick</b> your current nickname<br />"
                       " - <b>$channel</b> the name of the selected channel<br /><br />"
                       " - <b>$0</b> the whole string.<br />"
                       " - <b>$nick</b> your current nickname<br />"
                       " - <b>$channel</b> the name of the selected channel<br /><br />"