summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-06-28 11:24:19 -0400
committerAdam <Adam@anope.org>2010-06-28 11:24:19 -0400
commitf1cb4b86b7b89430ee87cfb301f143e1e57c1b2d (patch)
treefc8c5f3fcee5fc7beea880be7b3bc4366e7a50b4 /src/main.cpp
parent4502038e3da0e176e194aabfd64c85544bb0aa23 (diff)
Delete all users when we disconnect from the uplink
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e1b3c1ee3..f5eb3c915 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -551,6 +551,16 @@ int main(int ac, char **av, char **envp)
unsigned j = 0;
for (; j < (Config.MaxRetries ? Config.MaxRetries : j + 1); ++j)
{
+ /* Clear all of our users, but not our bots */
+ for (user_map::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; )
+ {
+ User *u = it->second;
+ ++it;
+
+ if (!findbot(u->nick))
+ delete u;
+ }
+
Alog() << "Disconnected from the server, retrying in " << Config.RetryWait << " seconds";
sleep(Config.RetryWait);