summaryrefslogtreecommitdiff
path: root/modules/commands/os_defcon.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-03 11:41:32 -0500
committerAdam <Adam@anope.org>2013-01-03 12:34:01 -0500
commit098157dca8a4aecc18294cbc31cbe5ee95b35a94 (patch)
tree654f00f21e151ba9007ca8eb044a78fef1bd6e39 /modules/commands/os_defcon.cpp
parent827469600e8cf98fea7aec09ceaa77a097300b72 (diff)
Don't delete users immediately when quit or killed, instead wait until message processing is done
Diffstat (limited to 'modules/commands/os_defcon.cpp')
-rw-r--r--modules/commands/os_defcon.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp
index 1457a57dc..4bcf9de38 100644
--- a/modules/commands/os_defcon.cpp
+++ b/modules/commands/os_defcon.cpp
@@ -408,27 +408,6 @@ class OSDefcon : public Module
this->ParseModeString();
}
- EventReturn OnUserConnect(User *u, bool &exempt)
- {
- if (!exempt && u->server->IsSynced() && DConfig.Check(DEFCON_AKILL_NEW_CLIENTS) && !u->server->IsULined())
- {
- if (DConfig.Check(DEFCON_AKILL_NEW_CLIENTS) && akills)
- {
- Log(OperServ, "operserv/defcon") << "DEFCON: adding akill for *@" << u->host;
- XLine *x = new XLine("*@" + u->host, Config->OperServ, Anope::CurTime + DConfig.akillexpire, DConfig.akillreason, XLineManager::GenerateUID());
- x->by = Config->OperServ;
- akills->AddXLine(x);
- }
-
- if (DConfig.Check(DEFCON_NO_NEW_CLIENTS) || DConfig.Check(DEFCON_AKILL_NEW_CLIENTS))
- u->Kill(Config->OperServ, DConfig.akillreason);
-
- return EVENT_STOP;
- }
-
- return EVENT_CONTINUE;
- }
-
EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelModeName Name, const Anope::string &param) anope_override
{
ChannelMode *cm = ModeManager::FindChannelModeByName(Name);
@@ -501,9 +480,9 @@ class OSDefcon : public Module
return EVENT_CONTINUE;
}
- void OnUserConnect(Reference<User> &u, bool &exempt) anope_override
+ void OnUserConnect(User *u, bool &exempt) anope_override
{
- if (exempt || !u || !u->server->IsSynced() || u->server->IsULined())
+ if (exempt || !u->Quitting() || !u->server->IsSynced() || u->server->IsULined())
return;
if (DConfig.Check(DEFCON_AKILL_NEW_CLIENTS) && akills)