From a2b647c5cd99da15f65d38c55e077581e3f1f6c2 Mon Sep 17 00:00:00 2001 From: prozacx Date: Thu, 13 Oct 2005 05:21:47 +0000 Subject: [PATCH] Added List and Help commands git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@570 726aef4b-f618-498e-8847-2d620e286838 --- modules/partyline.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/partyline.cpp b/modules/partyline.cpp index ae8894ba..ad206431 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -186,7 +186,22 @@ public: virtual void OnModCommand(const CString& sLine) { CString sCommand = sLine.Token(0); - if (sCommand.CaseCmp("LIST") == 0) { + if (sCommand.CaseCmp("HELP") == 0) { + CTable Table; + Table.AddColumn("Command"); + Table.AddColumn("Arguments"); + Table.AddColumn("Description"); + + Table.AddRow(); Table.SetCell("Command", "Help"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "List all partyline commands"); + Table.AddRow(); Table.SetCell("Command", "List"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "List all open channels"); + + unsigned int uTableIdx = 0; + CString sLine; + + while (Table.GetLine(uTableIdx++, sLine)) { + PutModule(sLine); + } + } else if (sCommand.CaseCmp("LIST") == 0) { if (!m_msChans.size()) { PutModule("There are no open channels."); return; @@ -210,6 +225,8 @@ public: while (Table.GetLine(uTableIdx++, sLine)) { PutModule(sLine); } + } else { + PutModule("Unkown command, try 'HELP'"); } }