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_group.cpp | |
parent | d320c73f23ff7a9b848b86b59c6bf91c1254e410 (diff) |
Fixed formatting of many lists and INFO outputs
Diffstat (limited to 'modules/commands/ns_group.cpp')
-rw-r--r-- | modules/commands/ns_group.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 6a83f4f46..b8e9087dc 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -250,16 +250,27 @@ class CommandNSGList : public Command source.Reply(nick.empty() ? NICK_NOT_REGISTERED : _(NICK_X_NOT_REGISTERED), nick.c_str()); else { - source.Reply(!nick.empty() ? _("List of nicknames in the group of \002%s\002:") : _("List of nicknames in your group:"), nc->display.c_str()); + ListFormatter list; + list.addColumn("Nick").addColumn("Expires"); for (std::list<NickAlias *>::const_iterator it = nc->aliases.begin(), it_end = nc->aliases.end(); it != it_end; ++it) { NickAlias *na2 = *it; - source.Reply(na2->HasFlag(NS_NO_EXPIRE) || !Config->NSExpire ? _(" %s (does not expire)") : _(" %s (expires in %s)"), na2->nick.c_str(), do_strftime(na2->last_seen + Config->NSExpire).c_str()); + ListFormatter::ListEntry entry; + entry["Nick"] = na2->nick; + entry["Expires"] = (na2->HasFlag(NS_NO_EXPIRE) || !Config->NSExpire) ? "Does not expire" : ("expires in " + do_strftime(na2->last_seen + Config->NSExpire)); + list.addEntry(entry); } + + source.Reply(!nick.empty() ? _("List of nicknames in the group of \002%s\002:") : _("List of nicknames in your group:"), nc->display.c_str()); + std::vector<Anope::string> replies; + list.Process(replies); + + for (unsigned i = 0; i < replies.size(); ++i) + source.Reply(replies[i]); + source.Reply(_("%d nicknames in the group."), nc->aliases.size()); } - return; } bool OnHelp(CommandSource &source, const Anope::string &subcommand) |