]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
Add sanity checks to the ssl modules so that theres no possibility of an out of range...
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index 8f5b830f2e109e8f8625e3d26b6ca564959e4593..74e4453762a9ad132b1cd9758890d2c55fd33462 100644 (file)
  * ---------------------------------------------------
  */
 
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "hashcomp.h"
 #include "inspircd.h"
 
 /* $ModDesc: Povides support for ircu-style services accounts, including chmode +R, etc. */
@@ -116,7 +112,7 @@ class ModuleServicesAccount : public Module
        AChannel_M* m2;
        AUser_R* m3;
  public:
-       ModuleServicesAccount(InspIRCd* Me) : Module::Module(Me)
+       ModuleServicesAccount(InspIRCd* Me) : Module(Me)
        {
                
                m1 = new AChannel_R(ServerInstance);
@@ -225,7 +221,7 @@ class ModuleServicesAccount : public Module
        // this method is called. We should use the ProtoSendMetaData function after we've
        // corrected decided how the data should look, to send the metadata on its way if
        // it is ours.
-       virtual void OnSyncUserMetaData(userrec* user, Module* proto, void* opaque, const std::string &extname)
+       virtual void OnSyncUserMetaData(userrec* user, Module* proto, void* opaque, const std::string &extname, bool displayable)
        {
                // check if the linking module wants to know about OUR metadata
                if (extname == "accountname")
@@ -235,7 +231,7 @@ class ModuleServicesAccount : public Module
                        user->GetExt("accountname", account);
                        if (account)
                        {
-                               // atheme puts a space on this at logout, trim it
+                               // remove any accidental leading/trailing spaces
                                trim(*account);
 
                                // call this function in the linking module, let it format the data how it
@@ -305,7 +301,7 @@ class ModuleServicesAccount : public Module
                                if (!dest->GetExt("accountname", text))
                                {
                                        text = new std::string(extdata);
-                                       // atheme puts a space on this at logout, trim it
+                                       // remove any accidental leading/trailing spaces
                                        trim(*text);
                                        dest->Extend("accountname", text);
                                }
@@ -318,9 +314,9 @@ class ModuleServicesAccount : public Module
                ServerInstance->Modes->DelMode(m1);
                ServerInstance->Modes->DelMode(m2);
                ServerInstance->Modes->DelMode(m3);
-               DELETE(m1);
-               DELETE(m2);
-               DELETE(m3);
+               delete m1;
+               delete m2;
+               delete m3;
        }
        
        virtual Version GetVersion()
@@ -329,27 +325,4 @@ class ModuleServicesAccount : public Module
        }
 };
 
-
-class ModuleServicesAccountFactory : public ModuleFactory
-{
- public:
-       ModuleServicesAccountFactory()
-       {
-       }
-       
-       ~ModuleServicesAccountFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleServicesAccount(Me);
-       }
-       
-};
-
-
-extern "C" void * init_module( void )
-{
-       return new ModuleServicesAccountFactory;
-}
+MODULE_INIT(ModuleServicesAccount)