diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-09 13:21:35 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-09 13:21:35 +0000 |
commit | c330b24501fc56516fef098428889a0a526e706a (patch) | |
tree | 83a64774409c8c6808dd4c6a2587ca89229e9e97 /src/helperfuncs.cpp | |
parent | 68da120812b1e593c76ea75d0d591f47b6a4f402 (diff) |
Added userrec::modebits - fast way of checking if user has +swi rather than an icky strchr
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3588 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 27bc22007..effffd6e9 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -975,7 +975,7 @@ void WriteOpers(char* text, ...) if (IS_LOCAL(a)) { - if (strchr(a->modes,'s')) + if (a->modebits & UM_SERVERNOTICE) { // send server notices to all with +s WriteServ(a->fd,"NOTICE %s :%s",a->nick,textbuffer); @@ -1118,7 +1118,7 @@ void WriteWallOps(userrec *source, bool local_only, char* text, ...) { userrec* t = (userrec*)(*i); - if ((IS_LOCAL(t)) && (strchr(t->modes,'w'))) + if ((IS_LOCAL(t)) && (t->modebits & UM_WALLOPS)) { WriteTo(source,t,"WALLOPS :%s",textbuffer); } @@ -1335,7 +1335,7 @@ void userlist(userrec *user,chanrec *c) for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++) { - if ((!has_user) && (strchr(i->second->modes,'i'))) + if ((!has_user) && (i->second->modebits & UM_INVISIBLE)) { /* * user is +i, and source not on the channel, does not show @@ -1378,7 +1378,7 @@ int usercount_i(chanrec *c) CUList *ulist= c->GetUsers(); for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++) { - if (!strchr(i->second->modes,'i')) + if (i->second->modebits & UM_INVISIBLE) count++; } @@ -1467,7 +1467,7 @@ int usercount_invisible(void) for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) { - if ((i->second->registered == 7) && (strchr(i->second->modes,'i'))) + if ((i->second->registered == 7) && (i->second->modebits & UM_INVISIBLE)) c++; } |