summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 13:21:35 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 13:21:35 +0000
commitc330b24501fc56516fef098428889a0a526e706a (patch)
tree83a64774409c8c6808dd4c6a2587ca89229e9e97 /src/mode.cpp
parent68da120812b1e593c76ea75d0d591f47b6a4f402 (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/mode.cpp')
-rw-r--r--src/mode.cpp32
1 files changed, 27 insertions, 5 deletions
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;
}
}
}