summaryrefslogtreecommitdiff
path: root/modules/commands/bs_info.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
committerAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
commit2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch)
tree36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/bs_info.cpp
parent873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff)
Allow userless command sources
Diffstat (limited to 'modules/commands/bs_info.cpp')
-rw-r--r--modules/commands/bs_info.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp
index 251bd84df..d5b2693ad 100644
--- a/modules/commands/bs_info.cpp
+++ b/modules/commands/bs_info.cpp
@@ -59,10 +59,9 @@ class CommandBSInfo : public Command
{
const Anope::string &query = params[0];
- User *u = source.u;
const BotInfo *bi = findbot(query);
ChannelInfo *ci;
- InfoFormatter info(u);
+ InfoFormatter info(source.nc);
if (bi)
{
@@ -79,7 +78,7 @@ class CommandBSInfo : public Command
for (unsigned i = 0; i < replies.size(); ++i)
source.Reply(replies[i]);
- if (u->HasPriv("botserv/administration"))
+ if (source.HasPriv("botserv/administration"))
{
std::vector<Anope::string> buf;
this->send_bot_channels(buf, bi);
@@ -90,7 +89,7 @@ class CommandBSInfo : public Command
}
else if ((ci = cs_findchan(query)))
{
- if (!ci->AccessFor(u).HasPriv("FOUNDER") && !u->HasPriv("botserv/administration"))
+ if (!source.AccessFor(ci).HasPriv("FOUNDER") && !source.HasPriv("botserv/administration"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -99,8 +98,8 @@ class CommandBSInfo : public Command
source.Reply(CHAN_INFO_HEADER, ci->name.c_str());
info[_("Bot nick")] = ci->bi ? ci->bi->nick : "not assigned yet";
- Anope::string enabled = translate(u, _("Enabled"));
- Anope::string disabled = translate(u, _("Disabled"));
+ Anope::string enabled = translate(source.nc, _("Enabled"));
+ Anope::string disabled = translate(source.nc, _("Disabled"));
if (ci->botflags.HasFlag(BS_KICK_BADWORDS))
{
@@ -203,11 +202,11 @@ class CommandBSInfo : public Command
info[_("AMSG kicker")] = disabled;
Anope::string flags;
- CheckOptStr(flags, BS_DONTKICKOPS, _("Ops protection"), ci->botflags, u->Account());
- CheckOptStr(flags, BS_DONTKICKVOICES, _("Voices protection"), ci->botflags, u->Account());
- CheckOptStr(flags, BS_FANTASY, _("Fantasy"), ci->botflags, u->Account());
- CheckOptStr(flags, BS_GREET, _("Greet"), ci->botflags, u->Account());
- CheckOptStr(flags, BS_NOBOT, _("No bot"), ci->botflags, u->Account());
+ CheckOptStr(flags, BS_DONTKICKOPS, _("Ops protection"), ci->botflags, source.nc);
+ CheckOptStr(flags, BS_DONTKICKVOICES, _("Voices protection"), ci->botflags, source.nc);
+ CheckOptStr(flags, BS_FANTASY, _("Fantasy"), ci->botflags, source.nc);
+ CheckOptStr(flags, BS_GREET, _("Greet"), ci->botflags, source.nc);
+ CheckOptStr(flags, BS_NOBOT, _("No bot"), ci->botflags, source.nc);
info[_("Options")] = flags.empty() ? _("None") : flags;