mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Use a CTable to list all the commands to be performed in the perform module
This commit is contained in:
@@ -37,16 +37,28 @@ class CPerform : public CModule {
|
||||
}
|
||||
|
||||
void List(const CString& sCommand) {
|
||||
int i = 1;
|
||||
CTable Table;
|
||||
unsigned int index = 1;
|
||||
CString sExpanded;
|
||||
for (VCString::const_iterator it = m_vPerform.begin(); it != m_vPerform.end(); it++, i++) {
|
||||
|
||||
Table.AddColumn("Id");
|
||||
Table.AddColumn("Perform");
|
||||
Table.AddColumn("Expanded");
|
||||
|
||||
for (VCString::const_iterator it = m_vPerform.begin(); it != m_vPerform.end(); it++, index++) {
|
||||
Table.AddRow();
|
||||
Table.SetCell("Id", CString(index));
|
||||
Table.SetCell("Perform", *it);
|
||||
|
||||
sExpanded = GetUser()->ExpandString(*it);
|
||||
if (sExpanded != *it)
|
||||
PutModule(CString(i) + ": " + *it + " (" + sExpanded + ")");
|
||||
else
|
||||
PutModule(CString(i) + ": " + *it);
|
||||
if (sExpanded != *it) {
|
||||
Table.SetCell("Expanded", sExpanded);
|
||||
}
|
||||
}
|
||||
|
||||
if (PutModule(Table) == 0) {
|
||||
PutModule("No commands in your perform list.");
|
||||
}
|
||||
PutModule(" -- End of List");
|
||||
}
|
||||
|
||||
void Execute(const CString& sCommand) {
|
||||
|
||||
Reference in New Issue
Block a user