summaryrefslogtreecommitdiff
path: root/src/modes/umode_n.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-10 15:20:41 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-10 15:20:41 +0000
commit2816a3ff87c3c15848dfe7f71391a454992ecefe (patch)
treee31985a9ac9255bd90e26cf6200137eb2e289c32 /src/modes/umode_n.cpp
parentd2381df1f7ba0e7dd2226b83e9e3c98c5cbd8808 (diff)
- Add usermode +n for notice masks - our implementation of snomasks. We're not sure how this will tie in with +s yet.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4274 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modes/umode_n.cpp')
-rw-r--r--src/modes/umode_n.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/modes/umode_n.cpp b/src/modes/umode_n.cpp
new file mode 100644
index 000000000..6c1b380f3
--- /dev/null
+++ b/src/modes/umode_n.cpp
@@ -0,0 +1,26 @@
+#include "inspircd.h"
+#include "mode.h"
+#include "channels.h"
+#include "users.h"
+#include "modes/umode_n.h"
+
+ModeUserServerNoticeMask::ModeUserServerNoticeMask() : ModeHandler('n', 1, 0, false, MODETYPE_USER, true)
+{
+}
+
+ModeAction ModeUserServerNoticeMask::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+{
+ /* Only opers can change other users modes */
+ if ((source != dest) && (!*source->oper))
+ return MODEACTION_DENY;
+
+ /* Set the bitfields */
+ if (dest->modes[UM_SERVERNOTICE] != adding)
+ {
+ dest->modes[UM_SERVERNOTICE] = adding;
+ return MODEACTION_ALLOW;
+ }
+
+ /* Allow the change */
+ return MODEACTION_DENY;
+}