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

Delete all of our known users when we lose connection to the uplink

This commit is contained in:
Adam
2010-06-28 13:16:55 -04:00
parent 77ec1f2fa7
commit 147c58bd32
4 changed files with 15 additions and 10 deletions
+9
View File
@@ -557,6 +557,15 @@ int main(int ac, char **av, char **envp)
{
FOREACH_MOD(I_OnServerDisconnect, OnServerDisconnect());
/* Clear all of our users */
User *u = firstuser();
while (u)
{
User *unext = nextuser();
delete u;
u = unext;
}
unsigned j = 0;
for (; j < (Config.MaxRetries ? Config.MaxRetries : j + 1); ++j)
{
-3
View File
@@ -218,9 +218,6 @@ static void delete_server(Server * serv, const char *quitreason)
if (na->last_quit)
delete [] na->last_quit;
na->last_quit = (quitreason ? sstrdup(quitreason) : NULL);
}
if (Config.LimitSessions && !is_ulined(u->server->name)) {
del_session(u->host);
}
delete u;
}
+5 -6
View File
@@ -251,6 +251,11 @@ User::~User()
this->chans.front()->chan->DeleteUser(this);
}
if (Config.LimitSessions && !is_ulined(this->server->name))
{
del_session(this->host);
}
if (this->prev)
this->prev->next = this->next;
else
@@ -1059,9 +1064,6 @@ void do_quit(const char *source, int ac, const char **av)
delete [] na->last_quit;
na->last_quit = *av[0] ? sstrdup(av[0]) : NULL;
}
if (Config.LimitSessions && !is_ulined(user->server->name)) {
del_session(user->host);
}
FOREACH_MOD(I_OnUserQuit, OnUserQuit(user, *av[0] ? av[0] : ""));
delete user;
}
@@ -1092,9 +1094,6 @@ void do_kill(const std::string &nick, const std::string &msg)
delete [] na->last_quit;
na->last_quit = !msg.empty() ? sstrdup(msg.c_str()) : NULL;
}
if (Config.LimitSessions && !is_ulined(user->server->name)) {
del_session(user->host);
}
delete user;
}
+1 -1
View File
@@ -8,7 +8,7 @@
VERSION_MAJOR="1"
VERSION_MINOR="9"
VERSION_PATCH="2"
VERSION_EXTRA="-p1"
VERSION_EXTRA="-p2"
VERSION_BUILD="1"