From c5ce187e0fc2d507331a8cc247c52d6cd8573c81 Mon Sep 17 00:00:00 2001 From: kroimon Date: Fri, 26 Sep 2008 12:52:07 +0000 Subject: [PATCH] Added descriptive lines to the LISTMODS and LISTAVAILMODS commands. Also did a few minor style changes. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1216 726aef4b-f618-498e-8847-2d620e286838 --- ClientCommand.cpp | 67 ++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/ClientCommand.cpp b/ClientCommand.cpp index f92b979b..2a063a9b 100644 --- a/ClientCommand.cpp +++ b/ClientCommand.cpp @@ -592,6 +592,7 @@ void CClient::UserCommand(const CString& sLine) { if (!GModules.size()) { PutStatus("No global modules loaded."); } else { + PutStatus("Global modules:"); CTable GTable; GTable.AddColumn("Name"); GTable.AddColumn("Description"); @@ -604,7 +605,6 @@ void CClient::UserCommand(const CString& sLine) { unsigned int uTableIdx = 0; CString sTmp; - while (GTable.GetLine(uTableIdx++, sTmp)) { PutStatus(sTmp); } @@ -616,23 +616,23 @@ void CClient::UserCommand(const CString& sLine) { if (!Modules.size()) { PutStatus("You have no modules loaded."); - return; - } + } else { + PutStatus("User modules:"); + CTable Table; + Table.AddColumn("Name"); + Table.AddColumn("Description"); - CTable Table; - Table.AddColumn("Name"); - Table.AddColumn("Description"); + for (unsigned int b = 0; b < Modules.size(); b++) { + Table.AddRow(); + Table.SetCell("Name", Modules[b]->GetModName()); + Table.SetCell("Description", Modules[b]->GetDescription().Ellipsize(128)); + } - for (unsigned int b = 0; b < Modules.size(); b++) { - Table.AddRow(); - Table.SetCell("Name", Modules[b]->GetModName()); - Table.SetCell("Description", Modules[b]->GetDescription().Ellipsize(128)); - } - - unsigned int uTableIdx = 0; - CString sTmp; - while (Table.GetLine(uTableIdx++, sTmp)) { - PutStatus(sTmp); + unsigned int uTableIdx = 0; + CString sTmp; + while (Table.GetLine(uTableIdx++, sTmp)) { + PutStatus(sTmp); + } } } #else @@ -653,6 +653,7 @@ void CClient::UserCommand(const CString& sLine) { if (!ssGlobalMods.size()) { PutStatus("No global modules available."); } else { + PutStatus("Global modules:"); CTable GTable; GTable.AddColumn("Name"); GTable.AddColumn("Description"); @@ -680,25 +681,25 @@ void CClient::UserCommand(const CString& sLine) { if (!ssUserMods.size()) { PutStatus("No user modules available."); - return; - } + } else { + PutStatus("User modules:"); + CTable Table; + Table.AddColumn("Name"); + Table.AddColumn("Description"); + set::iterator it; - CTable Table; - Table.AddColumn("Name"); - Table.AddColumn("Description"); - set::iterator it; + for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) { + const CModInfo& Info = *it; + Table.AddRow(); + Table.SetCell("Name", (m_pUser->GetModules().FindModule(Info.GetName()) ? "*" : " ") + Info.GetName()); + Table.SetCell("Description", Info.GetDescription().Ellipsize(128)); + } - for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) { - const CModInfo& Info = *it; - Table.AddRow(); - Table.SetCell("Name", (m_pUser->GetModules().FindModule(Info.GetName()) ? "*" : " ") + Info.GetName()); - Table.SetCell("Description", Info.GetDescription().Ellipsize(128)); - } - - unsigned int uTableIdx = 0; - CString sTmp; - while (Table.GetLine(uTableIdx++, sTmp)) { - PutStatus(sTmp); + unsigned int uTableIdx = 0; + CString sTmp; + while (Table.GetLine(uTableIdx++, sTmp)) { + PutStatus(sTmp); + } } } #else