]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_opersha256.cpp
Added <oper:swhois> to m_swhois, which will override <type:swhois> if specified
[user/henk/code/inspircd.git] / src / modules / m_opersha256.cpp
index 451a2c1958978dc7d29cd99ac4c3eca5a16284d2..055c559ada6fbd78a5716f396e58ffec4eea78f1 100644 (file)
@@ -44,7 +44,7 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "helperfuncs.h"
+
 #include "inspircd.h"
 
 
@@ -56,6 +56,8 @@ using namespace std;
 typedef unsigned int uint32_t;
 #endif
 
+/** An sha 256 context, used by m_opersha256
+ */
 class SHA256Context : public classbase
 {
  public:
@@ -225,20 +227,23 @@ void SHA256(const char *src, char *dest, int len)
        }
 }
 
+/** Handle /MKSHA256
+ */
 class cmd_mksha256 : public command_t
 {
 public:
-       cmd_mksha256() : command_t("MKSHA256", 'o', 1)
+       cmd_mksha256 (InspIRCd* Instance) : command_t(Instance,"MKSHA256", 'o', 1)
        {
                this->source = "m_opersha256.so";
                syntax = "<any-text>";
        }
 
-       void Handle(const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle(const char** parameters, int pcnt, userrec *user)
        {
                char buffer[SHA256_BLOCK_SIZE + 1];
                SHA256(parameters[0], buffer, strlen(parameters[0]));
-               user->WriteServ( "NOTICE %s :SHA256 hashed password for %s is %s", user->nick, parameters[0], buffer);
+               user->WriteServ("NOTICE %s :SHA256 hashed password for %s is %s", user->nick, parameters[0], buffer);
+               return CMD_SUCCESS;
        }
 };
 
@@ -250,7 +255,7 @@ public:
        ModuleOperSHA256(InspIRCd* Me) : Module::Module(Me)
        {
                
-               mksha256cmd = new cmd_mksha256();
+               mksha256cmd = new cmd_mksha256(ServerInstance);
                ServerInstance->AddCommand(mksha256cmd);
        }
 
@@ -279,7 +284,7 @@ public:
 
        virtual Version GetVersion()
        {
-               return Version(1, 0, 0, 1, 0);
+               return Version(1, 1, 0, 1, VF_VENDOR, API_VERSION);
        }
 };