]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_helpop.cpp
Merge pull request #249 from Shawn-Smith/insp20+simplemode
[user/henk/code/inspircd.git] / src / modules / m_helpop.cpp
index a7bd4a8c56969addd51d5bb8b80c940c21186939..60c23f45bd44820c39b5e01496a804551c535a1c 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-/* $ModDesc: Provides the /HELPOP command, works like UnrealIRCd's helpop */
+/* $ModDesc: Provides the /HELPOP command for useful information */
 
 #include "inspircd.h"
 
@@ -29,35 +29,13 @@ static std::map<irc::string, std::string> helpop_map;
 
 /** Handles user mode +h
  */
-class Helpop : public ModeHandler
+class Helpop : public SimpleUserModeHandler
 {
  public:
-       Helpop(Module* Creator) : ModeHandler(Creator, "helpop", 'h', PARAM_NONE, MODETYPE_USER)
+       Helpop(Module* Creator) : SimpleUserModeHandler(Creator, "helpop", 'h')
        {
                oper = true;
        }
-
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
-       {
-               if (adding)
-               {
-                       if (!dest->IsModeSet('h'))
-                       {
-                               dest->SetMode('h',true);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-               else
-               {
-                       if (dest->IsModeSet('h'))
-                       {
-                               dest->SetMode('h',false);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-
-               return MODEACTION_DENY;
-       }
 };
 
 /** Handles /HELPOP
@@ -188,7 +166,7 @@ class ModuleHelpop : public Module
 
                Version GetVersion()
                {
-                       return Version("Provides the /HELPOP command, works like UnrealIRCd's helpop", VF_VENDOR);
+                       return Version("Provides the /HELPOP command for useful information", VF_VENDOR);
                }
 };