aboutsummaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-12-30 14:34:49 +0000
committerGravatar brain2006-12-30 14:34:49 +0000
commitfce2d243c023660a9afbf01143cde6eda2ec7a88 (patch)
treefcf7276b29c2b546780e4626d4cdccdd1b08ea8a /src/users.cpp
parentChange description for insp_aton since only a positive return means convertio... (diff)
Add unregistered user counter, this may also fix the (minor) m_conn_lusers shows current connection as unregged
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6170 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 44947fa6c..e4f63e3ba 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -766,7 +766,11 @@ void userrec::QuitUser(InspIRCd* Instance, userrec *user, const std::string &qui
if (reason.length() > MAXQUIT - 1)
reason.resize(MAXQUIT - 1);
-
+
+ if (user->registered != REG_ALL)
+ if (Instance->unregistered_count)
+ Instance->unregistered_count--;
+
if (IS_LOCAL(user))
{
user->Write("ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason.c_str());
@@ -983,6 +987,8 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
userrec* New;
int j = 0;
+ Instance->unregistered_count++;
+
/*
* fix by brain.
* as these nicknames are 'RFC impossible', we can be sure nobody is going to be
@@ -1177,6 +1183,10 @@ void userrec::FullConnect(CullList* Goners)
this->ShowMOTD();
+ /* Now registered */
+ if (ServerInstance->unregistered_count)
+ ServerInstance->unregistered_count--;
+
/*
* fix 3 by brain, move registered = 7 below these so that spurious modes and host
* changes dont go out onto the network and produce 'fake direction'.