]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/mode.h
Change SWHOIS to OPTCOMMON, remove m_operinvex
[user/henk/code/inspircd.git] / include / mode.h
index 0c367a1c2548ac68c071fb0a0a42fa6f952b49b2..2c0e30be47d14081b286879ae284b706067bd435 100644 (file)
@@ -152,7 +152,6 @@ class CoreExport ModeHandler : public classbase
        int levelrequired;
 
  public:
-       static InspIRCd* ServerInstance;
        /** Module that created this mode. NULL for core modes */
        Module* creator;
 
@@ -231,6 +230,16 @@ class CoreExport ModeHandler : public classbase
         */
        virtual std::string GetUserParameter(User* useor);
 
+       /**
+        * Called when a channel mode change access check for your mode occurs.
+        * @param source Contains the user setting the mode.
+        * @param channel contains the destination channel the modes are being set on.
+        * @param parameter The parameter for your mode. This is modifiable.
+        * @param adding This value is true when the mode is being set, or false when it is being unset.
+        * @return allow, deny, or passthru to check against the required level
+        */
+       virtual ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding);
+
        /**
         * Called when a mode change for your mode occurs.
         * @param source Contains the user setting the mode.
@@ -277,7 +286,7 @@ class CoreExport ModeHandler : public classbase
         * @param channel The channel we are checking against
         * @return True if the other side wins the merge, false if we win the merge for this mode.
         */
-       virtual bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel* channel);
+       virtual bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel);
 
        /**
         * When a remote server needs to bounce a set of modes, it will call this method for every mode
@@ -313,7 +322,7 @@ class CoreExport ModeHandler : public classbase
         * @param channel The channel which the server wants to remove your mode from
         */
        virtual void RemoveMode(Channel* channel, irc::modestacker* stack = NULL);
-       
+
        inline unsigned int GetLevelRequired() const { return levelrequired; }
 };
 
@@ -339,7 +348,7 @@ class CoreExport SimpleUserModeHandler : public ModeHandler
 class CoreExport SimpleChannelModeHandler : public ModeHandler
 {
  public:
-       SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
+       SimpleChannelModeHandler(Module* Creator, char modeletter)
                : ModeHandler(Creator, modeletter, PARAM_NONE, MODETYPE_CHANNEL) {}
        virtual ~SimpleChannelModeHandler() {}
        virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
@@ -354,10 +363,6 @@ class CoreExport SimpleChannelModeHandler : public ModeHandler
 class CoreExport ModeWatcher : public classbase
 {
  protected:
-       /**
-        * Creator/owner pointer
-        */
-       InspIRCd* ServerInstance;
        /**
         * The mode letter this class is watching
         */
@@ -371,7 +376,7 @@ class CoreExport ModeWatcher : public classbase
        /**
         * The constructor initializes the mode and the mode type
         */
-       ModeWatcher(InspIRCd* Instance, char modeletter, ModeType type);
+       ModeWatcher(char modeletter, ModeType type);
        /**
         * The default destructor does nothing.
         */
@@ -425,10 +430,6 @@ typedef std::vector<ModeWatcher*>::iterator ModeWatchIter;
 class CoreExport ModeParser : public classbase
 {
  private:
-       /**
-        * Creator/owner pointer
-        */
-       InspIRCd* ServerInstance;
        /** Mode handlers for each mode, to access a handler subtract
         * 65 from the ascii value of the mode letter.
         * The upper bit of the value indicates if its a usermode
@@ -469,7 +470,7 @@ class CoreExport ModeParser : public classbase
 
        /** The constructor initializes all the RFC basic modes by using ModeParserAddMode().
         */
-       ModeParser(InspIRCd* Instance);
+       ModeParser();
        ~ModeParser();
 
        /** Used to check if user 'd' should be allowed to do operation 'MASK' on channel 'chan'.