From adb17635ee183184a341accb5dfb275c34fb8fb0 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 7 Jul 2006 20:03:17 +0000 Subject: Added cmode_m (channel mode +m) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4141 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modes/cmode_m.h | 8 ++++++++ src/modes/cmode_m.cpp | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 include/modes/cmode_m.h create mode 100644 src/modes/cmode_m.cpp diff --git a/include/modes/cmode_m.h b/include/modes/cmode_m.h new file mode 100644 index 000000000..d8cff2aa4 --- /dev/null +++ b/include/modes/cmode_m.h @@ -0,0 +1,8 @@ +#include "mode.h" + +class ModeChannelModerated : public ModeHandler +{ + public: + ModeChannelModerated(); + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); +}; diff --git a/src/modes/cmode_m.cpp b/src/modes/cmode_m.cpp new file mode 100644 index 000000000..b3c41df12 --- /dev/null +++ b/src/modes/cmode_m.cpp @@ -0,0 +1,23 @@ +#include "inspircd.h" +#include "mode.h" +#include "channels.h" +#include "users.h" +#include "modes/cmode_m.h" + +ModeChannelModerated::ModeChannelModerated() : ModeHandler('m', 0, 0, false, MODETYPE_CHANNEL, false) +{ +} + +ModeAction ModeChannelModerated::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) +{ + if (channel->modes[CM_MODERATED] != adding) + { + channel->modes[CM_MODERATED] = adding; + return MODEACTION_ALLOW; + } + else + { + return MODEACTION_DENY; + } +} + -- cgit v1.2.3