]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
Add 906, sasl aborted
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index a9c5b89b3a825c93f9bf0d33684b745dd38bb5bb..8ec346db25bd07476fe2a70b2ae93aab466f3709 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -24,7 +24,7 @@ class SSLMode : public ModeHandler
  public:
        SSLMode(InspIRCd* Instance) : ModeHandler(Instance, 'z', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
-       ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
                if (adding)
                {
@@ -75,16 +75,14 @@ class ModuleSSLModes : public Module
                
 
                sslm = new SSLMode(ServerInstance);
-               if (!ServerInstance->AddMode(sslm, 'z'))
+               if (!ServerInstance->Modes->AddMode(sslm))
                        throw ModuleException("Could not add new modes!");
+               Implementation eventlist[] = { I_OnUserPreJoin };
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnUserPreJoin] = 1;
-       }
 
-       virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
+       virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs)
        {
                if(chan && chan->IsModeSet('z'))
                {
@@ -107,7 +105,7 @@ class ModuleSSLModes : public Module
        virtual ~ModuleSSLModes()
        {
                ServerInstance->Modes->DelMode(sslm);
-               DELETE(sslm);
+               delete sslm;
        }
        
        virtual Version GetVersion()
@@ -117,5 +115,5 @@ class ModuleSSLModes : public Module
 };
 
 
-MODULE_INIT(ModuleSSLModes);
+MODULE_INIT(ModuleSSLModes)