]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_helpop.cpp
Annotations
[user/henk/code/inspircd.git] / src / modules / m_helpop.cpp
index 46b82b23449127441d9c78bc3755b98000044ee7..330a5d60ed55d566ab3f92e1c8914a0fbc2d4e3c 100644 (file)
@@ -19,19 +19,18 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "helperfuncs.h"
 #include "inspircd.h"
 
 // Global Vars
 static ConfigReader *helpop;
 
-
-
 bool do_helpop(const char**, int, userrec*);
 void sendtohelpop(userrec*, int, const char**);
 
 /* $ModDesc: /helpop Command, Works like Unreal helpop */
 
+/** Handles user mode +h
+ */
 class Helpop : public ModeHandler
 {
  public:
@@ -60,6 +59,8 @@ class Helpop : public ModeHandler
        }
 };
 
+/** Handles /HELPOP
+ */
 class cmd_helpop : public command_t
 {
  public:
@@ -69,18 +70,18 @@ class cmd_helpop : public command_t
                 syntax = "[?|!]<any-text>";
         }
 
-       void Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
        {
                char a[MAXBUF];
                std::string output = " ";
 
                if (!helpop)
-                       return;
+                       return CMD_FAILURE;
 
                if (pcnt < 1)
                {
                        do_helpop(NULL,pcnt,user);
-                       return;
+                       return CMD_SUCCESS;
                }
 
                if (*parameters[0] == '!')
@@ -126,6 +127,8 @@ class cmd_helpop : public command_t
                                sendtohelpop(user, pcnt, parameters);
                        }
                }
+
+               return CMD_SUCCESS;
        }
 
 
@@ -180,6 +183,8 @@ class cmd_helpop : public command_t
        }
 };
 
+/** Thrown by m_helpop
+ */
 class HelpopException : public ModuleException
 {
  private:
@@ -254,6 +259,7 @@ class ModuleHelpop : public Module
 
                virtual ~ModuleHelpop()
                {
+                       ServerInstance->Modes->DelMode(ho);
                        DELETE(conf);
                        DELETE(helpop);
                        DELETE(ho);
@@ -261,7 +267,7 @@ class ModuleHelpop : public Module
        
                virtual Version GetVersion()
                {
-                       return Version(1,0,0,1,VF_STATIC|VF_VENDOR);
+                       return Version(1,0,0,1,VF_COMMON|VF_VENDOR);
                }
 };