mirror of
https://github.com/znc/znc.git
synced 2026-05-03 03:52:33 +02:00
Add a new function CModule::PutModule(const CTable&)
This function displays a CTable via PutModule(), something that is often needed. The function returns the number of lines displayed. The idea for this function is from the user-contributed admin module by Sebastian Ramacher. Thanks. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1168 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
10
Modules.cpp
10
Modules.cpp
@@ -503,6 +503,16 @@ bool CModule::PutUser(const CString& sLine) {
|
||||
bool CModule::PutStatus(const CString& sLine) {
|
||||
return (m_pUser) ? m_pUser->PutStatus(sLine, m_pClient) : false;
|
||||
}
|
||||
unsigned int CModule::PutModule(const CTable& table, const CString& sIdent, const CString& sHost) {
|
||||
if (!m_pUser)
|
||||
return 0;
|
||||
|
||||
unsigned int idx = 0;
|
||||
CString sLine;
|
||||
while (table.GetLine(idx++, sLine))
|
||||
PutModule(sLine, sIdent, sHost);
|
||||
return idx - 1;
|
||||
}
|
||||
bool CModule::PutModule(const CString& sLine, const CString& sIdent, const CString& sHost) {
|
||||
if (!m_pUser)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user