From 2dec8e767a70def4b9b04a96ae4f75e4d1013038 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 18 Jun 2012 05:04:30 -0400 Subject: Allow userless command sources --- modules/commands/cs_clearusers.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/commands/cs_clearusers.cpp') diff --git a/modules/commands/cs_clearusers.cpp b/modules/commands/cs_clearusers.cpp index 58de57f5a..1c26fe382 100644 --- a/modules/commands/cs_clearusers.cpp +++ b/modules/commands/cs_clearusers.cpp @@ -26,7 +26,6 @@ class CommandCSClearUsers : public Command { const Anope::string &chan = params[0]; - User *u = source.u; Channel *c = findchan(chan); Anope::string modebuf; @@ -40,13 +39,13 @@ class CommandCSClearUsers : public Command source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); return; } - else if (!c->ci->AccessFor(u).HasPriv("FOUNDER") && !u->HasCommand("chanserv/clearusers")) + else if (!source.AccessFor(c->ci).HasPriv("FOUNDER") && !source.HasCommand("chanserv/clearusers")) { source.Reply(ACCESS_DENIED); return; } - Anope::string buf = "CLEARUSERS command from " + u->nick + " (" + u->Account()->display + ")"; + Anope::string buf = "CLEARUSERS command from " + source.GetNick() + " (" + source.nc->display + ")"; for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ) { @@ -55,8 +54,8 @@ class CommandCSClearUsers : public Command c->Kick(NULL, uc->user, "%s", buf.c_str()); } - bool override = !c->ci->AccessFor(u).HasPriv("FOUNDER"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci); + bool override = !source.AccessFor(c->ci).HasPriv("FOUNDER"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, c->ci); source.Reply(_("All users have been kicked from \002%s\002."), chan.c_str()); -- cgit