Support $i:ident in aliases
authorSvetlana Tkachenko <svetlana@members.fsf.org>
Mon, 8 Jan 2018 00:39:45 +0000 (00:39 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Mar 2018 21:25:59 +0000 (23:25 +0200)
https://bugs.quassel-irc.org/issues/1454

Implements #1454.

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

index 3d049fa..e7cdec6 100644 (file)
@@ -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);
index 39b475a..99b03d2 100644 (file)
@@ -64,6 +64,7 @@ QVariant AliasesModel::data(const QModelIndex &index, int role) const
                       " - <b>$i..j</b> represents the i'th to j'th parameter separated by spaces.<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>$0</b> the whole string.<br />"
                       " - <b>$nick</b> your current nickname<br />"
                       " - <b>$channel</b> the name of the selected channel<br /><br />"