]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modes/umode_i.cpp
Extra debug all over the place, which maybe we should keep
[user/henk/code/inspircd.git] / src / modes / umode_i.cpp
1 #include "inspircd.h"
2 #include "mode.h"
3 #include "channels.h"
4 #include "users.h"
5 #include "modes/umode_i.h"
6
7 ModeUserInvisible::ModeUserInvisible() : ModeHandler('i', 0, 0, false, MODETYPE_USER, false)
8 {
9 }
10
11 ModeAction ModeUserInvisible::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
12 {
13         /* Only opers can change other users modes */
14         if ((source != dest) && (!*source->oper))
15                 return MODEACTION_DENY;
16
17         /* Set the bitfields */
18         if (dest->modes[UM_INVISIBLE] != adding)
19         {
20                 dest->modes[UM_INVISIBLE] = adding;
21                 return MODEACTION_ALLOW;
22         }
23
24         /* Allow the change */
25         return MODEACTION_DENY;
26 }