summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-28 12:00:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-28 12:00:25 +0000
commit95840640cb374a0845c866bd1ad56a04dd833081 (patch)
tree17fb64980c11b26d33967f58064f3579d2a1ca4d /src/helperfuncs.cpp
parent9296aee7bc95c0fb2a0d00f76b908eba99e730af (diff)
Change all references to voodoo numbers (7, 3 etc) to the new bitwise constants for user->registered
Change a lot of user->fd > -1 to use the IS_LOCAL() macro git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4569 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 39294cbb3..5f236b668 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -699,7 +699,7 @@ void WriteCommon(userrec *u, char* text, ...)
return;
}
- if (u->registered != 7)
+ if (u->registered != REG_ALL)
{
log(DEFAULT,"*** BUG *** WriteCommon on an unregistered user");
return;
@@ -750,7 +750,7 @@ void WriteCommon_NoFormat(userrec *u, const char* text)
return;
}
- if (u->registered != 7)
+ if (u->registered != REG_ALL)
{
log(DEFAULT,"*** BUG *** WriteCommon on an unregistered user");
return;
@@ -806,7 +806,7 @@ void WriteCommonExcept(userrec *u, char* text, ...)
return;
}
- if (u->registered != 7)
+ if (u->registered != REG_ALL)
{
log(DEFAULT,"*** BUG *** WriteCommon on an unregistered user");
return;
@@ -894,7 +894,7 @@ void WriteCommonExcept_NoFormat(userrec *u, const char* text)
return;
}
- if (u->registered != 7)
+ if (u->registered != REG_ALL)
{
log(DEFAULT,"*** BUG *** WriteCommon on an unregistered user");
return;
@@ -1425,7 +1425,7 @@ void send_error(char *s)
for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
{
userrec* t = (userrec*)(*i);
- if (t->registered == 7)
+ if (t->registered == REG_ALL)
{
WriteServ(t->fd,"NOTICE %s :%s",t->nick,s);
}
@@ -1485,7 +1485,7 @@ int registered_usercount(void)
for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
{
- if (i->second->registered == 7) c++;
+ c += (i->second->registered == REG_ALL);
}
return c;
@@ -1497,8 +1497,7 @@ int usercount_invisible(void)
for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
{
- if ((i->second->registered == 7) && (i->second->modes[UM_INVISIBLE]))
- c++;
+ c += ((i->second->registered == REG_ALL) && (i->second->modes[UM_INVISIBLE]));
}
return c;
@@ -1523,7 +1522,7 @@ int usercount_unknown(void)
for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
{
userrec* t = (userrec*)(*i);
- if (t->registered != 7)
+ if (t->registered != REG_ALL)
c++;
}
@@ -1542,7 +1541,7 @@ long local_count()
for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
{
userrec* t = (userrec*)(*i);
- if (t->registered == 7)
+ if (t->registered == REG_ALL)
c++;
}