]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
Add const std::string &original_command to OnPreCommand and OnPostCommand, which...
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index aff73dde57c14817ca9f129e3bc7fb9038c69cba..739ad611972370045a242fe012f708fcba8dba0a 100644 (file)
 
 using namespace std;
 
-#include <stdio.h>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include <string>
-
 #include "hashcomp.h"
 #include "inspircd.h"
 
 /* $ModDesc: Povides support for ircu-style services accounts, including chmode +R, etc. */
 
-
-
+/** Channel mode +R - unidentified users cannot join
+ */
 class AChannel_R : public ModeHandler
 {
  public:
@@ -57,6 +54,8 @@ class AChannel_R : public ModeHandler
        }
 };
 
+/** User mode +R - unidentified users cannot message
+ */
 class AUser_R : public ModeHandler
 {
  public:
@@ -85,6 +84,8 @@ class AUser_R : public ModeHandler
        }
 };
 
+/** Channel mode +M - unidentified users cannot message channel
+ */
 class AChannel_M : public ModeHandler
 {
  public:
@@ -104,7 +105,7 @@ class AChannel_M : public ModeHandler
                {
                        if (channel->IsModeSet('M'))
                        {
-                               channel->SetMode('M',true);
+                               channel->SetMode('M',false);
                                return MODEACTION_ALLOW;
                        }
                }
@@ -131,10 +132,6 @@ class ModuleServicesAccount : public Module
                ServerInstance->AddMode(m3, 'R');
        }
 
-       virtual void On005Numeric(std::string &output)
-       {
-       }
-
        /* <- :twisted.oscnet.org 330 w00t2 w00t2 w00t :is logged in as */
        virtual void OnWhois(userrec* source, userrec* dest)
        {
@@ -149,7 +146,7 @@ class ModuleServicesAccount : public Module
 
        void Implements(char* List)
        {
-               List[I_OnWhois] = List[I_OnUserPreMessage] = List[I_On005Numeric] = List[I_OnUserPreNotice] = List[I_OnUserPreJoin] = 1;
+               List[I_OnWhois] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnUserPreJoin] = 1;
                List[I_OnSyncUserMetaData] = List[I_OnUserQuit] = List[I_OnCleanup] = List[I_OnDecodeMetaData] = 1;
        }
 
@@ -314,6 +311,9 @@ class ModuleServicesAccount : public Module
 
        virtual ~ModuleServicesAccount()
        {
+               ServerInstance->Modes->DelMode(m1);
+               ServerInstance->Modes->DelMode(m2);
+               ServerInstance->Modes->DelMode(m3);
                DELETE(m1);
                DELETE(m2);
                DELETE(m3);
@@ -321,7 +321,7 @@ class ModuleServicesAccount : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
+               return Version(1,0,0,0,VF_COMMON|VF_VENDOR);
        }
 };