mirror of
https://github.com/anope/anope.git
synced 2026-07-08 04:23:14 +02:00
Don't delete users immediately when quit or killed, instead wait until message processing is done
This commit is contained in:
@@ -351,9 +351,9 @@ class CSSeen : public Module
|
||||
purger.SetSecs(expiretimeout);
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &u, bool &exempt) anope_override
|
||||
void OnUserConnect(User *u, bool &exempt) anope_override
|
||||
{
|
||||
if (u)
|
||||
if (!u->Quitting())
|
||||
UpdateUser(u, NEW, u->nick, "", "", "");
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ¶m) 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)
|
||||
|
||||
@@ -719,9 +719,9 @@ class ModuleDNS : public Module
|
||||
}
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &u, bool &exempt) anope_override
|
||||
void OnUserConnect(User *u, bool &exempt) anope_override
|
||||
{
|
||||
if (u && u->server)
|
||||
if (!u->Quitting() && u->server)
|
||||
{
|
||||
DNSServer *s = DNSServer::Find(u->server->GetName());
|
||||
/* Check for user limit reached */
|
||||
|
||||
@@ -252,9 +252,9 @@ class OSForbid : public Module
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &u, bool &exempt) anope_override
|
||||
void OnUserConnect(User *u, bool &exempt) anope_override
|
||||
{
|
||||
if (!u || exempt)
|
||||
if (u->Quitting() || exempt)
|
||||
return;
|
||||
|
||||
this->OnUserNickChange(u, "");
|
||||
|
||||
@@ -405,9 +405,9 @@ class OSNews : public Module
|
||||
DisplayNews(u, NEWS_OPER);
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &user, bool &) anope_override
|
||||
void OnUserConnect(User *user, bool &) anope_override
|
||||
{
|
||||
if (!user || !user->server->IsSynced())
|
||||
if (user->Quitting() || !user->server->IsSynced())
|
||||
return;
|
||||
|
||||
DisplayNews(user, NEWS_LOGON);
|
||||
|
||||
@@ -718,9 +718,9 @@ class OSSession : public Module
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &user, bool &exempt) anope_override
|
||||
void OnUserConnect(User *user, bool &exempt) anope_override
|
||||
{
|
||||
if (user && Config->LimitSessions)
|
||||
if (!user->Quitting() && Config->LimitSessions)
|
||||
this->AddSession(user, exempt);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,9 +129,9 @@ class ModuleDNSBL : public Module
|
||||
}
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &user, bool &exempt) anope_override
|
||||
void OnUserConnect(User *user, bool &exempt) anope_override
|
||||
{
|
||||
if (exempt || !user || (!this->check_on_connect && !Me->IsSynced()) || !dnsmanager)
|
||||
if (exempt || user->Quitting() || (!this->check_on_connect && !Me->IsSynced()) || !dnsmanager)
|
||||
return;
|
||||
|
||||
if (!this->check_on_netburst && !user->server->IsSynced())
|
||||
|
||||
@@ -406,7 +406,7 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
||||
return queries;
|
||||
}
|
||||
|
||||
Query MySQLService::BuildInsert(const Anope::string &table, unsigned int id, Data &data) anope_override
|
||||
Query MySQLService::BuildInsert(const Anope::string &table, unsigned int id, Data &data)
|
||||
{
|
||||
/* Empty columns not present in the data set */
|
||||
const std::set<Anope::string> &known_cols = this->active_schema[table];
|
||||
|
||||
@@ -125,9 +125,10 @@ class HTTPProxyConnect : public ProxyConnect, public BufferedSocket
|
||||
return "HTTP";
|
||||
}
|
||||
|
||||
bool Read(const Anope::string &buf) anope_override
|
||||
bool ProcessRead() anope_override
|
||||
{
|
||||
if (buf == ProxyCheckString)
|
||||
BufferedSocket::ProcessRead();
|
||||
if (this->GetLine() == ProxyCheckString)
|
||||
{
|
||||
this->Ban();
|
||||
return false;
|
||||
@@ -341,9 +342,9 @@ class ModuleProxyScan : public Module
|
||||
}
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &user, bool &exempt) anope_override
|
||||
void OnUserConnect(User *user, bool &exempt) anope_override
|
||||
{
|
||||
if (exempt || !user || !Me->IsSynced() || !user->server->IsSynced())
|
||||
if (exempt || user->Quitting() || !Me->IsSynced() || !user->server->IsSynced())
|
||||
return;
|
||||
|
||||
/* At this time we only support IPv4 */
|
||||
|
||||
@@ -150,14 +150,11 @@ class BotServCore : public Module
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
Reference<User> user_reference(u);
|
||||
Reference<NickCore> nc_reference(u->Account());
|
||||
cmd->Execute(source, params);
|
||||
|
||||
if (user_reference && nc_reference)
|
||||
{
|
||||
FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, cmd, params));
|
||||
}
|
||||
if (!nc_reference)
|
||||
source.nc = NULL;
|
||||
FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, cmd, params));
|
||||
}
|
||||
|
||||
void OnJoinChannel(User *user, Channel *c) anope_override
|
||||
|
||||
@@ -303,9 +303,9 @@ class NickServCore : public Module
|
||||
}
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &u, bool &exempt) anope_override
|
||||
void OnUserConnect(User *u, bool &exempt) anope_override
|
||||
{
|
||||
if (!u || !u->server->IsSynced())
|
||||
if (u->Quitting() || !u->server->IsSynced())
|
||||
return;
|
||||
|
||||
const NickAlias *na = NickAlias::Find(u->nick);
|
||||
|
||||
@@ -237,9 +237,9 @@ class OperServCore : public Module
|
||||
Log(u, "oper", OperServ) << "is no longer an IRC operator";
|
||||
}
|
||||
|
||||
void OnUserConnect(Reference<User> &u, bool &exempt) anope_override
|
||||
void OnUserConnect(User *u, bool &exempt) anope_override
|
||||
{
|
||||
if (u && !exempt)
|
||||
if (!u->Quitting() && !exempt)
|
||||
XLineManager::CheckAll(u);
|
||||
}
|
||||
|
||||
@@ -249,11 +249,9 @@ class OperServCore : public Module
|
||||
this->sqlines.CheckAllXLines(u);
|
||||
}
|
||||
|
||||
EventReturn OnCheckKick(User *u, ChannelInfo *ci, bool &kick) anope_override
|
||||
EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) anope_override
|
||||
{
|
||||
if (this->sqlines.CheckChannel(ci->c))
|
||||
kick = true;
|
||||
return EVENT_CONTINUE;
|
||||
return this->sqlines.CheckChannel(ci->c) ? EVENT_STOP : EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
|
||||
Reference in New Issue
Block a user