]> jfr.im git - irc/evilnet/znc.git/commitdiff
Show channel indexes in ListChans command
authornjhanley <redacted>
Sun, 30 Aug 2020 22:15:22 +0000 (18:15 -0400)
committernjhanley <redacted>
Thu, 3 Sep 2020 04:27:15 +0000 (00:27 -0400)
src/ClientCommand.cpp

index abfd0531c013a1efa30c18b27c91e9573c6752d7..0809304fa45015c574ba568c21bc9bd4379200fd 100644 (file)
@@ -496,6 +496,7 @@ void CClient::UserCommand(CString& sLine) {
         }
 
         CTable Table;
+        Table.AddColumn(t_s("Index", "listchans"));
         Table.AddColumn(t_s("Name", "listchans"));
         Table.AddColumn(t_s("Status", "listchans"));
         Table.AddColumn(t_s("In config", "listchans"));
@@ -508,10 +509,12 @@ void CClient::UserCommand(CString& sLine) {
             Table.AddColumn(CString(cPerm));
         }
 
-        unsigned int uNumDetached = 0, uNumDisabled = 0, uNumJoined = 0;
+        unsigned int uNumDetached = 0, uNumDisabled = 0, uNumJoined = 0,
+                     uChanIndex = 1;
 
         for (const CChan* pChan : vChans) {
             Table.AddRow();
+            Table.SetCell(t_s("Index", "listchans"), CString(uChanIndex));
             Table.SetCell(t_s("Name", "listchans"),
                           pChan->GetPermStr() + pChan->GetName());
             Table.SetCell(
@@ -545,6 +548,8 @@ void CClient::UserCommand(CString& sLine) {
             if (pChan->IsDetached()) uNumDetached++;
             if (pChan->IsOn()) uNumJoined++;
             if (pChan->IsDisabled()) uNumDisabled++;
+
+            uChanIndex++;
         }
 
         PutStatus(Table);