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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user