1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 11:23:13 +02:00

Use dynamic_reference to check for users being killed from commands

This commit is contained in:
Adam
2011-04-03 18:19:29 -04:00
parent 905207093b
commit 74844c0f28
7 changed files with 8 additions and 13 deletions
+1 -2
View File
@@ -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);
}
}
}
+1 -2
View File
@@ -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;
+1 -2
View File
@@ -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
{
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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
{
+2 -1
View File
@@ -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();