From adcca250e114acc591795c017357b38f2b60beb2 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 24 Aug 2008 12:51:04 +0000 Subject: [PATCH] Use the new CModule::PutModule(const CTable&) in various modules git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1169 726aef4b-f618-498e-8847-2d620e286838 --- modules/autoattach.cpp | 14 ++------------ modules/autoop.cpp | 7 +------ modules/crypt.cpp | 9 +-------- modules/email.cpp | 6 +----- modules/partyline.cpp | 14 ++------------ modules/schat.cpp | 16 ++++------------ modules/watch.cpp | 16 ++-------------- 7 files changed, 13 insertions(+), 69 deletions(-) diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 4d6ea561..c5e789c9 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -90,12 +90,7 @@ public: } if (Table.size()) { - unsigned int uTableIdx = 0; - CString sTmp; - - while (Table.GetLine(uTableIdx++, sTmp)) { - PutModule(sTmp); - } + PutModule(Table); } else { PutModule("You have no entries."); } @@ -117,12 +112,7 @@ public: Table.SetCell("Description", "List all entries"); if (Table.size()) { - unsigned int uTableIdx = 0; - CString sTmp; - - while (Table.GetLine(uTableIdx++, sTmp)) { - PutModule(sTmp); - } + PutModule(Table); } else { PutModule("You have no entries."); } diff --git a/modules/autoop.cpp b/modules/autoop.cpp index b67c1db4..d2c04586 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -257,12 +257,7 @@ public: Table.SetCell("Channels", it->second->GetChannels()); } - CString sTmp; - unsigned int uTableIdx = 0; - - while (Table.GetLine(uTableIdx++, sTmp)) { - PutModule(sTmp); - } + PutModule(Table); } else if (sCommand.CaseCmp("ADDCHANS") == 0 || sCommand.CaseCmp("DELCHANS") == 0) { CString sUser = sLine.Token(1); CString sChans = sLine.Token(2, true); diff --git a/modules/crypt.cpp b/modules/crypt.cpp index d4d10775..a9da9846 100644 --- a/modules/crypt.cpp +++ b/modules/crypt.cpp @@ -132,14 +132,7 @@ public: Table.SetCell("Key", it->second); } - if (Table.size()) { - unsigned int uTableIdx = 0; - CString sLine; - - while (Table.GetLine(uTableIdx++, sLine)) { - PutModule(sLine); - } - } + PutModule(Table); } } else if (sCmd.CaseCmp("HELP") == 0) { PutModule("Try: SetKey, DelKey, ListKeys"); diff --git a/modules/email.cpp b/modules/email.cpp index 03fbc5b2..2f33e348 100644 --- a/modules/email.cpp +++ b/modules/email.cpp @@ -122,11 +122,7 @@ public: m_ssUidls = ssUidls; // keep the list in synch if (Table.size()) { - unsigned int uTableIdx = 0; - CString sLine; - while (Table.GetLine(uTableIdx++, sLine)) { - PutModule(sLine); - } + PutModule(Table); stringstream s; s << "You have " << vEmails.size() << " emails."; diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 39a9958f..fdb77b62 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -427,12 +427,7 @@ public: Table.SetCell("Arguments", ""); Table.SetCell("Description", "Show which users can not part this channel"); - unsigned int uTableIdx = 0; - CString sTmp; - - while (Table.GetLine(uTableIdx++, sTmp)) { - PutModule(sTmp); - } + PutModule(Table); } else if (sCommand.CaseCmp("LIST") == 0) { if (!m_ssChannels.size()) { PutModule("There are no open channels."); @@ -451,12 +446,7 @@ public: Table.SetCell("Users", CString((*a)->GetNicks().size())); } - unsigned int uTableIdx = 0; - CString sTmp; - - while (Table.GetLine(uTableIdx++, sTmp)) { - PutModule(sTmp); - } + PutModule(Table); } else if (sCommand.CaseCmp("ADDFIXCHAN") == 0) { if (!m_pUser->IsAdmin()) { PutModule("Access denied"); diff --git a/modules/schat.cpp b/modules/schat.cpp index 461502cd..effca58c 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -265,12 +265,8 @@ public: Table.SetCell("Port", CString(pSock->GetLocalPort())); } } - if (Table.size()) - { - unsigned int uTableIdx = 0; - CString sLine; - while (Table.GetLine(uTableIdx++, sLine)) - PutModule(sLine); + if (Table.size()) { + PutModule(Table); } else PutModule("No SDCCs currently in session"); @@ -342,12 +338,8 @@ public: } } if (Table.size()) - { - unsigned int uTableIdx = 0; - CString sLine; - while (Table.GetLine(uTableIdx++, sLine)) - PutModule(sLine); - } else + PutModule(Table); + else PutModule("Error Finding Sockets"); } else if (sCom.CaseCmp("help") == 0) diff --git a/modules/watch.cpp b/modules/watch.cpp index 4cd8d745..e5ba799a 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -336,12 +336,7 @@ private: } if (Table.size()) { - unsigned int uTableIdx = 0; - CString sLine; - - while (Table.GetLine(uTableIdx++, sLine)) { - PutModule(sLine); - } + PutModule(Table); } else { PutModule("You have no entries."); } @@ -451,14 +446,7 @@ private: Table.SetCell("Command", "Help"); Table.SetCell("Description", "This help."); - if (Table.size()) { - unsigned int uTableIdx = 0; - CString sLine; - - while (Table.GetLine(uTableIdx++, sLine)) { - PutModule(sLine); - } - } + PutModule(Table); } void Watch(const CString& sHostMask, const CString& sTarget, const CString& sPattern, bool bNotice = false) {