summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 22:46:35 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 22:46:35 +0000
commit7f4ee2f9f2e3af860d4c4eaa19d8f12611e5fe83 (patch)
treedd89df1ad2f154c9b5490e0cb058642945b3b404
parent98562fe7b8b715d90bdb4288e764823a39b51f21 (diff)
Add channel modes +n and +t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4156 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/modes/cmode_n.h8
-rw-r--r--include/modes/cmode_t.h8
-rw-r--r--src/modes/cmode_n.cpp23
-rw-r--r--src/modes/cmode_t.cpp23
4 files changed, 62 insertions, 0 deletions
diff --git a/include/modes/cmode_n.h b/include/modes/cmode_n.h
new file mode 100644
index 000000000..ebed70103
--- /dev/null
+++ b/include/modes/cmode_n.h
@@ -0,0 +1,8 @@
+#include "mode.h"
+
+class ModeChannelNoExternal : public ModeHandler
+{
+ public:
+ ModeChannelNoExternal();
+ ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
+};
diff --git a/include/modes/cmode_t.h b/include/modes/cmode_t.h
new file mode 100644
index 000000000..7e852400b
--- /dev/null
+++ b/include/modes/cmode_t.h
@@ -0,0 +1,8 @@
+#include "mode.h"
+
+class ModeChannelTopicOps : public ModeHandler
+{
+ public:
+ ModeChannelTopicOps();
+ ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
+};
diff --git a/src/modes/cmode_n.cpp b/src/modes/cmode_n.cpp
new file mode 100644
index 000000000..85b45626a
--- /dev/null
+++ b/src/modes/cmode_n.cpp
@@ -0,0 +1,23 @@
+#include "inspircd.h"
+#include "mode.h"
+#include "channels.h"
+#include "users.h"
+#include "modes/cmode_n.h"
+
+ModeChannelNoExternal::ModeChannelNoExternal() : ModeHandler('n', 0, 0, false, MODETYPE_CHANNEL, false)
+{
+}
+
+ModeAction ModeChannelNoExternal::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+{
+ if (channel->modes[CM_NOEXTERNAL] != adding)
+ {
+ channel->modes[CM_NOEXTERNAL] = adding;
+ return MODEACTION_ALLOW;
+ }
+ else
+ {
+ return MODEACTION_DENY;
+ }
+}
+
diff --git a/src/modes/cmode_t.cpp b/src/modes/cmode_t.cpp
new file mode 100644
index 000000000..ed4285f0c
--- /dev/null
+++ b/src/modes/cmode_t.cpp
@@ -0,0 +1,23 @@
+#include "inspircd.h"
+#include "mode.h"
+#include "channels.h"
+#include "users.h"
+#include "modes/cmode_t.h"
+
+ModeChannelTopicOps::ModeChannelTopicOps() : ModeHandler('t', 0, 0, false, MODETYPE_CHANNEL, false)
+{
+}
+
+ModeAction ModeChannelTopicOps::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+{
+ if (channel->modes[CM_OPTOPIC] != adding)
+ {
+ channel->modes[CM_OPTOPIC] = adding;
+ return MODEACTION_ALLOW;
+ }
+ else
+ {
+ return MODEACTION_DENY;
+ }
+}
+