diff options
| author | Adam <Adam@anope.org> | 2011-12-19 15:37:15 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-12-19 15:37:15 -0500 |
| commit | 45fc3ce1c41b06af6e03712988870ead95b72435 (patch) | |
| tree | 7b574d077f77707edb3916fb43dfa30dec8b0f54 /modules/commands/ns_ajoin.cpp | |
| parent | d320c73f23ff7a9b848b86b59c6bf91c1254e410 (diff) | |
Fixed formatting of many lists and INFO outputs
Diffstat (limited to 'modules/commands/ns_ajoin.cpp')
| -rw-r--r-- | modules/commands/ns_ajoin.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 1f578a7cf..3c9467f69 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -75,10 +75,24 @@ class CommandNSAJoin : public Command source.Reply(_("Your auto join list is empty.")); else { - source.Reply(_("Your auto join list:\n" - " Num Channel Key")); + ListFormatter list; + list.addColumn("Number").addColumn("Channel").addColumn("Key"); for (unsigned i = 0; i < channels->size(); ++i) - source.Reply(" %3d %-12s %s", i + 1, channels->at(i).first.c_str(), channels->at(i).second.c_str()); + { + ListFormatter::ListEntry entry; + entry["Number"] = stringify(i + 1); + entry["Channel"] = channels->at(i).first; + entry["Key"] = channels->at(i).second; + list.addEntry(entry); + } + + source.Reply(_("Your auto join list:")); + + std::vector<Anope::string> replies; + list.Process(replies); + + for (unsigned i = 0; i < replies.size(); ++i) + source.Reply(replies[i]); } } |
