summaryrefslogtreecommitdiff
path: root/modules/commands/cs_log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_log.cpp')
-rw-r--r--modules/commands/cs_log.cpp13
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());
}