summaryrefslogtreecommitdiff
path: root/modules/commands/os_ignore.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-12-19 15:37:15 -0500
committerAdam <Adam@anope.org>2011-12-19 15:37:15 -0500
commit45fc3ce1c41b06af6e03712988870ead95b72435 (patch)
tree7b574d077f77707edb3916fb43dfa30dec8b0f54 /modules/commands/os_ignore.cpp
parentd320c73f23ff7a9b848b86b59c6bf91c1254e410 (diff)
Fixed formatting of many lists and INFO outputs
Diffstat (limited to 'modules/commands/os_ignore.cpp')
-rw-r--r--modules/commands/os_ignore.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp
index 52edd04e9..d73a09197 100644
--- a/modules/commands/os_ignore.cpp
+++ b/modules/commands/os_ignore.cpp
@@ -188,17 +188,28 @@ class CommandOSIgnore : public Command
source.Reply(_("Ignore list is empty."));
else
{
- source.Reply(_("Services ignore list:\n"
- " Mask Creator Reason Expires"));
+ ListFormatter list;
+ list.addColumn("Mask").addColumn("Creator").addColumn("Reason").addColumn("Expires");
for (std::list<IgnoreData>::const_iterator ign = ignores.begin(), ign_end = ignores.end(); ign != ign_end; ++ign)
{
const IgnoreData &ignore = *ign;
- source.Reply(" %-11s %-11s %-11s %s", ignore.mask.c_str(), ignore.creator.c_str(), ignore.reason.c_str(), do_strftime(ignore.time).c_str());
+ ListFormatter::ListEntry entry;
+ entry["Mask"] = ignore.mask;
+ entry["Creator"] = ignore.creator;
+ entry["Reason"] = ignore.reason;
+ entry["Expires"] = do_strftime(ignore.time);
+ list.addEntry(entry);
}
- }
- return;
+ source.Reply(_("Services ignore list:"));
+
+ std::vector<Anope::string> replies;
+ list.Process(replies);
+
+ for (unsigned i = 0; i < replies.size(); ++i)
+ source.Reply(replies[i]);
+ }
}
void DoDel(CommandSource &source, const std::vector<Anope::string> &params)
@@ -266,7 +277,7 @@ class CommandOSIgnore : public Command
"Valid units are: \037s\037 for seconds, \037m\037 for minutes, \n"
"\037h\037 for hours and \037d\037 for days. \n"
"Combinations of these units are not permitted.\n"
- "To make Services permanently ignore the user, type 0 as time.\n"
+ "To make Services permanently ignore the user, type 0 as time.\n"
"When adding a \037mask\037, it should be in the format user@host\n"
"or nick!user@host, everything else will be considered a nick.\n"
"Wildcards are permitted.\n"