summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-05 23:12:38 -0500
committerAdam <Adam@anope.org>2012-11-06 11:02:12 -0500
commit0cf8d733953fd9c856c0519f2bccc94a3cb2eafa (patch)
treecd4405459cdae27db8eb3b12677a19a50f74079d
parent53b2bdfe5e157a9e5ca5d08873edebcd04511ae1 (diff)
Added log messages for all of the other chanserv commands that should be logged
-rw-r--r--modules/commands/cs_enforce.cpp36
-rw-r--r--modules/commands/cs_sync.cpp2
-rw-r--r--modules/commands/cs_tban.cpp2
-rw-r--r--modules/commands/cs_unban.cpp2
4 files changed, 29 insertions, 13 deletions
diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp
index 031b592c4..6c3fb3f39 100644
--- a/modules/commands/cs_enforce.cpp
+++ b/modules/commands/cs_enforce.cpp
@@ -18,32 +18,38 @@
class CommandCSEnforce : public Command
{
private:
- void DoSet(Channel *c)
+ void DoSet(CommandSource &source, Channel *c)
{
const ChannelInfo *ci = c->ci;
if (!ci)
return;
+ Log(LOG_COMMAND, source, this) << "to enforce set";
+
if (ci->HasFlag(CI_SECUREOPS))
- this->DoSecureOps(c);
+ this->DoSecureOps(source, c);
if (ci->HasFlag(CI_RESTRICTED))
- this->DoRestricted(c);
+ this->DoRestricted(source, c);
}
- void DoModes(Channel *c)
+ void DoModes(CommandSource &source, Channel *c)
{
+ Log(LOG_COMMAND, source, this) << "to enforce modes";
+
if (c->HasMode(CMODE_REGISTEREDONLY))
- this->DoCModeR(c);
+ this->DoCModeR(source, c);
}
- void DoSecureOps(Channel *c)
+ void DoSecureOps(CommandSource &source, Channel *c)
{
ChannelInfo *ci = c->ci;
if (!ci)
return;
+ Log(LOG_COMMAND, source, this) << "to enforce secureops";
+
/* Dirty hack to allow chan_set_correct_modes to work ok.
* We pretend like SECUREOPS is on so it doesn't ignore that
* part of the code. This way we can enforce SECUREOPS even
@@ -67,12 +73,14 @@ class CommandCSEnforce : public Command
ci->UnsetFlag(CI_SECUREOPS);
}
- void DoRestricted(Channel *c)
+ void DoRestricted(CommandSource &source, Channel *c)
{
ChannelInfo *ci = c->ci;
if (ci == NULL)
return;
+ Log(LOG_COMMAND, source, this) << "to enforce restricted";
+
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
{
UserContainer *uc = *it++;
@@ -89,7 +97,7 @@ class CommandCSEnforce : public Command
}
}
- void DoCModeR(Channel *c)
+ void DoCModeR(CommandSource &source, Channel *c)
{
ChannelInfo *ci = c->ci;
Anope::string mask;
@@ -97,6 +105,8 @@ class CommandCSEnforce : public Command
if (!ci)
return;
+ Log(LOG_COMMAND, source, this) << "to enforce registered only";
+
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
{
UserContainer *uc = *it++;
@@ -134,27 +144,27 @@ class CommandCSEnforce : public Command
{
if (what.empty() || what.equals_ci("SET"))
{
- this->DoSet(c);
+ this->DoSet(source, c);
source.Reply(_("Enforced %s"), !what.empty() ? what.c_str() : "SET");
}
else if (what.equals_ci("MODES"))
{
- this->DoModes(c);
+ this->DoModes(source, c);
source.Reply(_("Enforced %s"), what.c_str());
}
else if (what.equals_ci("SECUREOPS"))
{
- this->DoSecureOps(c);
+ this->DoSecureOps(source, c);
source.Reply(_("Enforced %s"), what.c_str());
}
else if (what.equals_ci("RESTRICTED"))
{
- this->DoRestricted(c);
+ this->DoRestricted(source, c);
source.Reply(_("Enforced %s"), what.c_str());
}
else if (what.equals_ci("+R"))
{
- this->DoCModeR(c);
+ this->DoCModeR(source, c);
source.Reply(_("Enforced %s"), what.c_str());
}
else
diff --git a/modules/commands/cs_sync.cpp b/modules/commands/cs_sync.cpp
index 411ba6282..e55864f1b 100644
--- a/modules/commands/cs_sync.cpp
+++ b/modules/commands/cs_sync.cpp
@@ -32,6 +32,8 @@ class CommandCSSync : public Command
source.Reply(ACCESS_DENIED);
else
{
+ Log(LOG_COMMAND, source, this, ci);
+
for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it)
chan_set_correct_modes((*it)->user, ci->c, 1, false);
diff --git a/modules/commands/cs_tban.cpp b/modules/commands/cs_tban.cpp
index 65746fdfc..1120d05d4 100644
--- a/modules/commands/cs_tban.cpp
+++ b/modules/commands/cs_tban.cpp
@@ -72,6 +72,8 @@ class CommandCSTBan : public Command
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);
+
source.Reply(_("%s banned from %s, will auto-expire in %s."), mask.c_str(), c->name.c_str(), duration(t).c_str());
}
diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp
index aaa336438..b60dfebcf 100644
--- a/modules/commands/cs_unban.cpp
+++ b/modules/commands/cs_unban.cpp
@@ -53,6 +53,8 @@ class CommandCSUnban : public Command
return;
}
+ Log(LOG_COMMAND, source, this, ci) << "to unban " << u2->nick;
+
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());