diff options
author | lethality <lethality@anope.org> | 2012-06-22 21:26:33 +0100 |
---|---|---|
committer | lethality <lethality@anope.org> | 2012-06-22 21:26:33 +0100 |
commit | d8a99d619f7ae301ecf188dc460b1f5c7cb791ac (patch) | |
tree | b327ce05b9b5cb598fbc829e48041d465bc2d579 /modules/commands/cs_log.cpp | |
parent | ba53c7eb03add30acefbbc95bbd8b4b825b465b0 (diff) | |
parent | 2dec8e767a70def4b9b04a96ae4f75e4d1013038 (diff) |
Merge branch '1.9' of ssh://anope.git.sf.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'modules/commands/cs_log.cpp')
-rw-r--r-- | modules/commands/cs_log.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 163789b53..0f680e111 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -28,11 +28,10 @@ public: { const Anope::string &channel = params[0]; - User *u = source.u; ChannelInfo *ci = cs_findchan(channel); if (ci == NULL) source.Reply(CHAN_X_NOT_REGISTERED, channel.c_str()); - else if (!ci->AccessFor(u).HasPriv("SET") && !u->HasPriv("chanserv/set")) + else if (!source.AccessFor(ci).HasPriv("SET") && !source.HasPriv("chanserv/set")) source.Reply(ACCESS_DENIED); else if (params.size() == 1) { @@ -108,7 +107,7 @@ public: return; } - bool override = !ci->AccessFor(u).HasPriv("SET"); + bool override = !source.AccessFor(ci).HasPriv("SET"); for (unsigned i = ci->log_settings->size(); i > 0; --i) { @@ -120,13 +119,13 @@ public: { log->destroy(); ci->log_settings->erase(ci->log_settings->begin() + i - 1); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to remove logging for " << command << " with method " << method << (extra == "" ? "" : " ") << extra; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to remove logging for " << command << " with method " << method << (extra == "" ? "" : " ") << extra; source.Reply(_("Logging for command %s on %s with log method %s%s%s has been removed."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); } else { log->extra = extra; - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to change logging for " << command << " to method " << method << (extra == "" ? "" : " ") << extra; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to change logging for " << command << " to method " << method << (extra == "" ? "" : " ") << extra; source.Reply(_("Logging changed for command %s on %s, now using log method %s%s%s."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); } return; @@ -141,10 +140,10 @@ public: log->method = method; log->extra = extra; log->created = Anope::CurTime; - log->creator = u->nick; + log->creator = source.GetNick(); ci->log_settings->push_back(log); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to log " << command << " with method " << method << (extra == "" ? "" : " ") << extra; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to log " << command << " with method " << method << (extra == "" ? "" : " ") << extra; source.Reply(_("Logging is now active for command %s on %s, using log method %s%s%s."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); } |