From c330b24501fc56516fef098428889a0a526e706a Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 9 Mar 2006 13:21:35 +0000 Subject: 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 --- src/mode.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/mode.cpp') diff --git a/src/mode.cpp b/src/mode.cpp index c343ed10b..418ad4eac 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -1239,9 +1239,20 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user) { charlcat(dmodes,*i,53); charlcat(outpars,*i,MAXMODES); - if (*i == 'o') + switch (*i) { - FOREACH_MOD(I_OnGlobalOper,OnGlobalOper(dest)); + case 'o': + FOREACH_MOD(I_OnGlobalOper,OnGlobalOper(dest)); + break; + case 'i': + dest->modebits |= UM_INVISIBLE; + break; + case 's': + dest->modebits |= UM_SERVERNOTICE; + break; + case 'w': + dest->modebits |= UM_WALLOPS; + break; } } } @@ -1254,10 +1265,21 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user) { charlcat(outpars,*i,MAXMODES); charremove(dmodes,*i); - if (*i == 'o') + switch (*i) { - *dest->oper = 0; - DeleteOper(dest); + case 'o': + *dest->oper = 0; + DeleteOper(dest); + break; + case 'i': + dest->modebits ^= UM_INVISIBLE; + break; + case 's': + dest->modebits ^= UM_SERVERNOTICE; + break; + case 'w': + dest->modebits ^= UM_WALLOPS; + break; } } } -- cgit v1.2.3