]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modes/cmode_i.cpp
Allow freaky stuff with +k when coming from a server or remote user (allow +k when...
[user/henk/code/inspircd.git] / src / modes / cmode_i.cpp
1 #include "inspircd.h"
2 #include "mode.h"
3 #include "channels.h"
4 #include "users.h"
5 #include "modes/cmode_i.h"
6
7 ModeChannelInviteOnly::ModeChannelInviteOnly() : ModeHandler('i', 0, 0, false, MODETYPE_CHANNEL, false)
8 {
9 }
10
11 ModeAction ModeChannelInviteOnly::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
12 {
13         if (channel->modes[CM_INVITEONLY] != adding)
14         {
15                 channel->modes[CM_INVITEONLY] = adding;
16                 return MODEACTION_ALLOW;
17         }
18         else
19         {
20                 return MODEACTION_DENY;
21         }
22 }