summaryrefslogtreecommitdiff
path: root/include/mode.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-01 16:12:45 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-01 16:12:45 +0000
commitf3abcf2bcfe36d3389b74caa9eef8582901fbe15 (patch)
tree2ebd9c1c6615939d850cf95866e9e982cb2b18d1 /include/mode.h
parent61416a1885d1490550175b6a73b724ba0843d729 (diff)
Simple user/channel mode patch
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9596 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/mode.h')
-rw-r--r--include/mode.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/mode.h b/include/mode.h
index e15ddeeb0..dcd8cc004 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -293,6 +293,32 @@ class CoreExport ModeHandler : public Extensible
void SetNeededPrefix(char needsprefix);
};
+/** A prebuilt mode handler which handles a simple user mode, e.g. no parameters, usable by any user, with no extra
+ * behaviour to the mode beyond the basic setting and unsetting of the mode, not allowing the mode to be set if it
+ * is already set and not allowing it to be unset if it is already unset.
+ * An example of a simple user mode is user mode +w.
+ */
+class CoreExport SimpleUserModeHandler : public ModeHandler
+{
+ public:
+ SimpleUserModeHandler(InspIRCd* Instance, char modeletter);
+ virtual ~SimpleUserModeHandler();
+ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
+};
+
+/** A prebuilt mode handler which handles a simple channel mode, e.g. no parameters, usable by any user, with no extra
+ * behaviour to the mode beyond the basic setting and unsetting of the mode, not allowing the mode to be set if it
+ * is already set and not allowing it to be unset if it is already unset.
+ * An example of a simple channel mode is channel mode +s.
+ */
+class CoreExport SimpleChannelModeHandler : public ModeHandler
+{
+ public:
+ SimpleChannelModeHandler(InspIRCd* Instance, char modeletter);
+ virtual ~SimpleChannelModeHandler();
+ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
+};
+
/**
* The ModeWatcher class can be used to alter the behaviour of a mode implemented
* by the core or by another module. To use ModeWatcher, derive a class from it,