summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-03 18:19:29 -0400
committerAdam <Adam@anope.org>2011-04-03 18:19:29 -0400
commit74844c0f287a875d19cc7b2fcaa13cb76a0f2061 (patch)
tree296d739713318ec815131c36d12c4ffd63fd9f0d
parent905207093b89a3c71ee3732d051555870c4d39f5 (diff)
Use dynamic_reference to check for users being killed from commands
-rw-r--r--modules/core/ns_ghost.cpp3
-rw-r--r--modules/core/ns_group.cpp3
-rw-r--r--modules/core/ns_identify.cpp3
-rw-r--r--modules/core/ns_recover.cpp3
-rw-r--r--modules/core/ns_release.cpp3
-rw-r--r--modules/core/os_login.cpp3
-rw-r--r--src/commands.cpp3
7 files changed, 8 insertions, 13 deletions
diff --git a/modules/core/ns_ghost.cpp b/modules/core/ns_ghost.cpp
index d8e0faf64..60bd9aea2 100644
--- a/modules/core/ns_ghost.cpp
+++ b/modules/core/ns_ghost.cpp
@@ -78,8 +78,7 @@ class CommandNSGhost : public Command
if (!pass.empty())
{
Log(LOG_COMMAND, u, this) << "with an invalid password for " << nick;
- if (bad_password(u))
- return MOD_STOP;
+ bad_password(u);
}
}
}
diff --git a/modules/core/ns_group.cpp b/modules/core/ns_group.cpp
index 463d36be6..ac891588d 100644
--- a/modules/core/ns_group.cpp
+++ b/modules/core/ns_group.cpp
@@ -137,8 +137,7 @@ class CommandNSGroup : public Command
{
Log(LOG_COMMAND, u, this) << "failed group for " << target->nick;
source.Reply(_(PASSWORD_INCORRECT));
- if (bad_password(u))
- return MOD_STOP;
+ bad_password(u);
}
}
return MOD_CONT;
diff --git a/modules/core/ns_identify.cpp b/modules/core/ns_identify.cpp
index 15f2ade94..529547dfb 100644
--- a/modules/core/ns_identify.cpp
+++ b/modules/core/ns_identify.cpp
@@ -49,8 +49,7 @@ class CommandNSIdentify : public Command
{
Log(LOG_COMMAND, u, this) << "and failed to identify";
source.Reply(_(PASSWORD_INCORRECT));
- if (bad_password(u))
- return MOD_STOP;
+ bad_password(u);
}
else
{
diff --git a/modules/core/ns_recover.cpp b/modules/core/ns_recover.cpp
index d78955f51..f9e088586 100644
--- a/modules/core/ns_recover.cpp
+++ b/modules/core/ns_recover.cpp
@@ -62,8 +62,7 @@ class CommandNSRecover : public Command
{
source.Reply(_(ACCESS_DENIED));
Log(LOG_COMMAND, u, this) << "with invalid password for " << nick;
- if (bad_password(u))
- return MOD_STOP;
+ bad_password(u);
}
}
else
diff --git a/modules/core/ns_release.cpp b/modules/core/ns_release.cpp
index 94126eef8..a6f5f862f 100644
--- a/modules/core/ns_release.cpp
+++ b/modules/core/ns_release.cpp
@@ -54,8 +54,7 @@ class CommandNSRelease : public Command
{
source.Reply(_(ACCESS_DENIED));
Log(LOG_COMMAND, u, this) << "invalid password for " << nick;
- if (bad_password(u))
- return MOD_STOP;
+ bad_password(u);
}
}
else
diff --git a/modules/core/os_login.cpp b/modules/core/os_login.cpp
index fe2da3aac..fcbae9cfe 100644
--- a/modules/core/os_login.cpp
+++ b/modules/core/os_login.cpp
@@ -36,8 +36,7 @@ class CommandOSLogin : public Command
else if (o->password != password)
{
source.Reply(_(PASSWORD_INCORRECT));
- if (bad_password(source.u))
- return MOD_STOP;
+ bad_password(source.u);
}
else
{
diff --git a/src/commands.cpp b/src/commands.cpp
index 233253319..cfff8c764 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -165,8 +165,9 @@ void mod_run_cmd(BotInfo *bi, User *u, ChannelInfo *ci, Command *c, const Anope:
return;
}
+ dynamic_reference<User> user_reference(u);
CommandReturn ret = c->Execute(source, params);
- if (ret != MOD_STOP)
+ if (ret != MOD_STOP && user_reference)
{
FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, c, params));
source.DoReply();