diff options
author | Robby <robby@chat.be> | 2012-01-07 04:10:30 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-01-07 04:10:30 -0500 |
commit | 9e713941277e8d745b1713a6500349a9d1ecb8e3 (patch) | |
tree | 8f6d8a8553316799154884f61573036c97ca0fff /modules/commands/cs_log.cpp | |
parent | dd64eac782b3ee5acc6d1068a0ef42142a035254 (diff) |
Cleaned up a lot of log messages, help replies, fixed cs_tban, and other small fixes
Diffstat (limited to 'modules/commands/cs_log.cpp')
-rw-r--r-- | modules/commands/cs_log.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 164398d63..a94608b4c 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -32,7 +32,7 @@ public: ChannelInfo *ci = cs_findchan(channel); if (ci == NULL) source.Reply(CHAN_X_NOT_REGISTERED, channel.c_str()); - else if (!ci->AccessFor(u).HasPriv("SET")) + else if (!ci->AccessFor(u).HasPriv("SET") && !u->HasPriv("chanserv/set")) source.Reply(ACCESS_DENIED); else if (params.size() == 1) { @@ -108,6 +108,8 @@ public: return; } + bool override = !ci->AccessFor(u).HasPriv("SET"); + for (unsigned i = ci->log_settings.size(); i > 0; --i) { LogSetting &log = ci->log_settings[i - 1]; @@ -117,12 +119,14 @@ public: if (log.extra == extra) { ci->log_settings.erase(ci->log_settings.begin() + i - 1); - source.Reply(_("Logging for command %s on %s with method %s%s has been removed."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : extra.c_str()); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, 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; - source.Reply(_("Logging changed for command %s on %s, using log method %s %s"), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.c_str()); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, 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; } @@ -139,9 +143,9 @@ public: log.creator = u->nick; ci->log_settings.push_back(log); - Log(LOG_COMMAND, u, this, ci) << command << " " << method << " " << extra; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, 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"), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.c_str()); + 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()); } else this->OnSyntaxError(source, ""); |