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/cs_unban.cpp | |
parent | 873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff) |
Allow userless command sources
Diffstat (limited to 'modules/commands/cs_unban.cpp')
-rw-r--r-- | modules/commands/cs_unban.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index 24d9caab8..91776b0c0 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -24,8 +24,6 @@ class CommandCSUnban : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; - ChannelInfo *ci = cs_findchan(params[0]); if (ci == NULL) { @@ -39,13 +37,13 @@ class CommandCSUnban : public Command return; } - if (!ci->AccessFor(u).HasPriv("UNBAN")) + if (!source.AccessFor(ci).HasPriv("UNBAN")) { source.Reply(ACCESS_DENIED); return; } - User *u2 = u; + User *u2 = source.GetUser(); if (params.size() > 1) u2 = finduser(params[1]); @@ -55,8 +53,8 @@ class CommandCSUnban : public Command return; } - common_unban(ci, u2, u == u2); - if (u2 == u) + common_unban(ci, u2, source.GetUser() == u2); + if (u2 == source.GetUser()) source.Reply(_("You have been unbanned from \002%s\002."), ci->c->name.c_str()); else source.Reply(_("\002%s\002 has been unbanned from \002%s\002."), u2->nick.c_str(), ci->c->name.c_str()); |