summaryrefslogtreecommitdiff
path: root/modules/commands/cs_status.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_status.cpp')
-rw-r--r--modules/commands/cs_status.cpp109
1 files changed, 56 insertions, 53 deletions
diff --git a/modules/commands/cs_status.cpp b/modules/commands/cs_status.cpp
index 7b7415fdb..e559f7749 100644
--- a/modules/commands/cs_status.cpp
+++ b/modules/commands/cs_status.cpp
@@ -27,73 +27,76 @@ public:
ChanServ::Channel *ci = ChanServ::Find(channel);
if (ci == NULL)
- source.Reply(CHAN_X_NOT_REGISTERED, channel.c_str());
- else if (!source.AccessFor(ci).HasPriv("ACCESS_CHANGE") && !source.HasPriv("chanserv/auspex"))
- source.Reply(ACCESS_DENIED);
+ {
+ source.Reply(_("Channel \002{0}\002 isn't registered."), channel);
+ return;
+ }
+
+ if (!source.AccessFor(ci).HasPriv("ACCESS_CHANGE") && !source.HasPriv("chanserv/auspex"))
+ {
+ source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "ACCESS_CHANGE", ci->name);
+ return;
+ }
+
+ Anope::string nick = source.GetNick();
+ if (params.size() > 1)
+ nick = params[1];
+
+ ChanServ::AccessGroup ag;
+ User *u = User::Find(nick, true);
+ NickServ::Nick *na = NULL;
+ if (u != NULL)
+ ag = ci->AccessFor(u);
else
{
- Anope::string nick = source.GetNick();
- if (params.size() > 1)
- nick = params[1];
-
- ChanServ::AccessGroup ag;
- User *u = User::Find(nick, true);
- NickServ::Nick *na = NULL;
- if (u != NULL)
- ag = ci->AccessFor(u);
- else
- {
- na = NickServ::FindNick(nick);
- if (na != NULL)
- ag = ci->AccessFor(na->nc);
- }
+ na = NickServ::FindNick(nick);
+ if (na != NULL)
+ ag = ci->AccessFor(na->nc);
+ }
- if (ag.super_admin)
- source.Reply(_("\002%s\002 is a super administrator."), nick.c_str());
- else if (ag.founder)
- source.Reply(_("\002%s\002 is the founder of \002%s\002."), nick.c_str(), ci->name.c_str());
- else if (ag.empty())
- source.Reply(_("\002%s\002 has no access on \002%s\002."), nick.c_str(), ci->name.c_str());
- else
- {
- source.Reply(_("Access for \002%s\002 on \002%s\002:"), nick.c_str(), ci->name.c_str());
+ if (ag.super_admin)
+ source.Reply(_("\002{0}\002 is a super administrator."), nick);
+ else if (ag.founder)
+ source.Reply(_("\002{0}\002 is the founder of \002{1}\002."), nick, ci->name);
+ else if (ag.empty())
+ source.Reply(_("\002{0}\002 has no access on \002{1}\002."), nick, ci->name);
+ else
+ {
+ source.Reply(_("Access for \002{0}\002 on \002{1}\002:"), nick, ci->name);
- for (unsigned i = 0; i < ag.size(); ++i)
- {
- ChanServ::ChanAccess *acc = ag[i];
+ for (unsigned i = 0; i < ag.size(); ++i)
+ {
+ ChanServ::ChanAccess *acc = ag[i];
- source.Reply(_("\002%s\002 matches access entry %s, which has privilege %s."), nick.c_str(), acc->mask.c_str(), acc->AccessSerialize().c_str());
- }
+ source.Reply(_("\002{0}\002 matches access entry \002{1}\002, which has privilege \002{2}\002."), nick, acc->mask, acc->AccessSerialize());
}
+ }
- for (unsigned j = 0, end = ci->GetAkickCount(); j < end; ++j)
+ for (unsigned j = 0, end = ci->GetAkickCount(); j < end; ++j)
+ {
+ AutoKick *autokick = ci->GetAkick(j);
+
+ if (autokick->nc)
+ {
+ if (na && *autokick->nc == na->nc)
+ source.Reply(_("\002{0}\002 is on the auto kick list of \002{1}\002 ({2})."), na->nc->display, ci->name, autokick->reason);
+ }
+ else if (u != NULL)
{
- AutoKick *autokick = ci->GetAkick(j);
-
- if (autokick->nc)
- {
- if (na && *autokick->nc == na->nc)
- source.Reply(_("\002%s\002 is on the auto kick list of \002%s\002 (%s)."), na->nc->display.c_str(), ci->name.c_str(), autokick->reason.c_str());
- }
- else if (u != NULL)
- {
- Entry akick_mask("", autokick->mask);
- if (akick_mask.Matches(u))
- source.Reply(_("\002%s\002 matches auto kick entry %s on \002%s\002 (%s)."), u->nick.c_str(), autokick->mask.c_str(), ci->name.c_str(), autokick->reason.c_str());
- }
+ Entry akick_mask("", autokick->mask);
+ if (akick_mask.Matches(u))
+ source.Reply(_("\002{0}\002 matches auto kick entry \002{1}\002 on \002{2}\002 ({3})."), u->nick, autokick->mask, ci->name, autokick->reason);
}
}
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("This command tells you what a users access is on a channel\n"
- "and what access entries, if any, they match. Additionally it\n"
- "will tell you of any auto kick entries they match. Usage of\n"
- "this command is limited to users who have the ability to modify\n"
- "access entries on the channel."));
+ source.Reply(_("This command tells you what access \037user\037 has on \037channel\037."
+ "It will also tell you which access and auto kick entries match \037user\037.\n"
+ "\n"
+ "Use of this command requires the \002{0}\002 privilege on \037channel\037."),
+ "ACCESS_CHANGE");
return true;
}
};