diff options
author | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
commit | 2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch) | |
tree | 36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/bs_set_greet.cpp | |
parent | 873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff) |
Allow userless command sources
Diffstat (limited to 'modules/commands/bs_set_greet.cpp')
-rw-r--r-- | modules/commands/bs_set_greet.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/commands/bs_set_greet.cpp b/modules/commands/bs_set_greet.cpp index 806f62f29..b74b0e5dd 100644 --- a/modules/commands/bs_set_greet.cpp +++ b/modules/commands/bs_set_greet.cpp @@ -24,7 +24,6 @@ class CommandBSSetGreet : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; ChannelInfo *ci = cs_findchan(params[0]); const Anope::string &value = params[1]; @@ -34,7 +33,7 @@ class CommandBSSetGreet : public Command return; } - if (!u->HasPriv("botserv/administration") && !ci->AccessFor(u).HasPriv("SET")) + if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET")) { source.Reply(ACCESS_DENIED); return; @@ -48,16 +47,16 @@ class CommandBSSetGreet : public Command if (value.equals_ci("ON")) { - bool override = !ci->AccessFor(u).HasPriv("SET"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to enable greets"; + bool override = !source.AccessFor(ci).HasPriv("SET"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable greets"; ci->botflags.SetFlag(BS_GREET); source.Reply(_("Greet mode is now \002on\002 on channel %s."), ci->name.c_str()); } else if (value.equals_ci("OFF")) { - bool override = !ci->AccessFor(u).HasPriv("SET"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to disable greets"; + bool override = !source.AccessFor(ci).HasPriv("SET"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable greets"; ci->botflags.UnsetFlag(BS_GREET); source.Reply(_("Greet mode is now \002off\002 on channel %s."), ci->name.c_str()); |