]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modes/umode_s.cpp
Snomask support cometh! and it leave a sticky white mess all over the floor :(
[user/henk/code/inspircd.git] / src / modes / umode_s.cpp
1 #include "inspircd.h"
2 #include "mode.h"
3 #include "channels.h"
4 #include "users.h"
5 #include "modes/umode_s.h"
6
7 ModeUserServerNotice::ModeUserServerNotice(InspIRCd* Instance) : ModeHandler(Instance, 's', 0, 0, false, MODETYPE_USER, false)
8 {
9 }
10
11 ModeAction ModeUserServerNotice::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_SERVERNOTICE] != adding)
19         {
20                 dest->modes[UM_SERVERNOTICE] = adding;
21                 return MODEACTION_ALLOW;
22         }
23
24         /* Allow the change */
25         return MODEACTION_DENY;
26 }