diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modes/cmode_n.cpp | 23 | ||||
-rw-r--r-- | src/modes/cmode_t.cpp | 23 |
2 files changed, 46 insertions, 0 deletions
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 ¶meter, 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 ¶meter, bool adding) +{ + if (channel->modes[CM_OPTOPIC] != adding) + { + channel->modes[CM_OPTOPIC] = adding; + return MODEACTION_ALLOW; + } + else + { + return MODEACTION_DENY; + } +} + |