diff options
Diffstat (limited to 'modules/commands/ns_alist.cpp')
-rw-r--r-- | modules/commands/ns_alist.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp index c80a479fc..d34357c32 100644 --- a/modules/commands/ns_alist.cpp +++ b/modules/commands/ns_alist.cpp @@ -47,18 +47,10 @@ class CommandNSAList : public Command list.AddColumn(_("Number")).AddColumn(_("Channel")).AddColumn(_("Access")); - source.Reply(_("Channels that \002%s\002 has access on:"), nc->display.c_str()); - std::deque<ChannelInfo *> queue; nc->GetChannelReferences(queue); std::sort(queue.begin(), queue.end(), ChannelSort); - if (queue.empty()) - { - source.Reply(_("\002%s\002 has no access in any channels."), nc->display.c_str()); - return; - } - for (unsigned i = 0; i < queue.size(); ++i) { ChannelInfo *ci = queue[i]; @@ -100,10 +92,20 @@ class CommandNSAList : public Command std::vector<Anope::string> replies; list.Process(replies); - for (unsigned i = 0; i < replies.size(); ++i) - source.Reply(replies[i]); - source.Reply(_("End of list - %d channels shown."), chan_count); + if (!chan_count) + { + source.Reply(_("\002%s\002 has no access in any channels."), nc->display.c_str()); + } + else + { + source.Reply(_("Channels that \002%s\002 has access on:"), nc->display.c_str()); + + for (unsigned i = 0; i < replies.size(); ++i) + source.Reply(replies[i]); + + source.Reply(_("End of list - %d channels shown."), chan_count); + } } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override |