diff options
author | Adam <Adam@anope.org> | 2012-11-22 00:50:33 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-22 00:50:33 -0500 |
commit | d33a0f75a5c0c584fbb7cc0076da36d494f39494 (patch) | |
tree | 7b2274cc833c793c0f5595660cbd4d715de52ffd /modules/commands/cs_tban.cpp | |
parent | 368d469631763e9c8bf399980d0ac7c5b5664d39 (diff) |
Pretty large coding style cleanup, in source doc
cleanup, and allow protocol mods to depend on each
other
Diffstat (limited to 'modules/commands/cs_tban.cpp')
-rw-r--r-- | modules/commands/cs_tban.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/commands/cs_tban.cpp b/modules/commands/cs_tban.cpp index 1120d05d4..40fdfedb9 100644 --- a/modules/commands/cs_tban.cpp +++ b/modules/commands/cs_tban.cpp @@ -22,7 +22,7 @@ static Module *me; class TempBan : public CallBack { private: - dynamic_reference<Channel> chan; + Reference<Channel> chan; Anope::string mask; public: @@ -46,7 +46,7 @@ class CommandCSTBan : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - Channel *c = findchan(params[0]); + Channel *c = Channel::Find(params[0]); const Anope::string &nick = params[1]; const Anope::string &time = params[2]; @@ -58,23 +58,22 @@ class CommandCSTBan : public Command source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); else if (!source.AccessFor(c->ci).HasPriv("BAN")) source.Reply(ACCESS_DENIED); - else if (!(u2 = finduser(nick))) + else if (!(u2 = User::Find(nick, true))) source.Reply(NICK_X_NOT_IN_USE, nick.c_str()); - else if (matches_list(c, u2, CMODE_EXCEPT)) + else if (c->MatchesList(u2, CMODE_EXCEPT)) source.Reply(CHAN_EXCEPTED, u2->nick.c_str(), c->ci->name.c_str()); else if (u2->IsProtected()) source.Reply(ACCESS_DENIED); else { - time_t t = dotime(time); - Anope::string mask; - get_idealban(c->ci, u2, mask); + time_t t = Anope::DoTime(time); + Anope::string mask = c->ci->GetIdealBan(u2); c->SetMode(NULL, CMODE_BAN, mask); new TempBan(t, c, mask); - Log(LOG_COMMAND, source, this, c->ci) << "for " << mask << " to expire in " << duration(t); + Log(LOG_COMMAND, source, this, c->ci) << "for " << mask << " to expire in " << Anope::Duration(t); - source.Reply(_("%s banned from %s, will auto-expire in %s."), mask.c_str(), c->name.c_str(), duration(t).c_str()); + source.Reply(_("%s banned from %s, will auto-expire in %s."), mask.c_str(), c->name.c_str(), Anope::Duration(t).c_str()); } return; |