summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 15:35:36 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 15:35:36 +0000
commit2d27d1f9f4fe54f9935a53e68b320e345c2cc1b1 (patch)
treee26c79baf5c5feda9f6f50e3b5f6b5ec52706393 /src/modes
parent7577c2376c09d9214645cefb2f87c054b79a0b1e (diff)
Add cmode_p (private)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4131 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cmode_p.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/modes/cmode_p.cpp b/src/modes/cmode_p.cpp
new file mode 100644
index 000000000..7ebdbf499
--- /dev/null
+++ b/src/modes/cmode_p.cpp
@@ -0,0 +1,22 @@
+#include "inspircd.h"
+#include "mode.h"
+#include "channels.h"
+#include "users.h"
+#include "modes/cmode_p.h"
+
+ModeChannelPrivate::ModeChannelPrivate() : ModeHandler('s', 0, 0, 0, MODETYPE_CHANNEL, false)
+{
+}
+
+ModeAction ModeChannelPrivate::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+{
+ if (channel->modes[CM_PRIVATE] != adding)
+ {
+ channel->modes[CM_PRIVATE] = adding;
+ return MODEACTION_ALLOW;
+ }
+ else
+ {
+ return MODEACTION_DENY;
+ }
+}