]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_samode.cpp
In the grand tradition of huge fucking commits:
[user/henk/code/inspircd.git] / src / modules / m_samode.cpp
index 7f3e9f428757ec79d7129d2411a085c126b1660f..b67730e27e03303eec4ef7e13bc6577181bcbaba 100644 (file)
 /* $ModDesc: Provides more advanced UnrealIRCd SAMODE command */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /** Handle /SAMODE
  */
-class cmd_samode : public command_t
+class cmd_samode : public Command
 {
  public:
-       cmd_samode (InspIRCd* Instance) : command_t(Instance,"SAMODE", 'o', 2)
+       cmd_samode (InspIRCd* Instance) : Command(Instance,"SAMODE", 'o', 2)
        {
                this->source = "m_samode.so";
                syntax = "<target> <modes> {<mode-parameters>}";
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, User *user)
        {
                /*
                 * Handles an SAMODE request. Notifies all +s users.
                 */
-
-               userrec* n = new userrec(ServerInstance);
-               n->SetFd(FD_MAGIC_NUMBER);
-               ServerInstance->SendMode(parameters,pcnt,n);
-               delete n;
+               ServerInstance->SendMode(parameters, pcnt, ServerInstance->FakeClient);
 
                if (ServerInstance->Modes->GetLastParse().length())
                {
@@ -58,7 +51,7 @@ class cmd_samode : public command_t
                        Event rmode2((char *)&n, NULL, "send_opers");
                        rmode2.Send(ServerInstance);
 
-                       /* XXX: Yes, this is right. We dont want to propogate the
+                       /* XXX: Yes, this is right. We dont want to propagate the
                         * actual SAMODE command, just the MODE command generated
                         * by the send_mode
                         */