]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_safelist.cpp
Add comments
[user/henk/code/inspircd.git] / src / modules / m_safelist.cpp
index a2135bd6bb4bade7a57b76e36beacc062b6271ec..b04701f5d9339c1a26f40b7aa7474fa37eb97955 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
@@ -42,6 +42,8 @@ class ModuleSafeList : public Module
        ModuleSafeList(InspIRCd* Me) : Module(Me)
        {
                OnRehash(NULL, "");
+               Implementation eventlist[] = { I_OnBufferFlushed, I_OnPreCommand, I_OnCleanup, I_OnUserQuit, I_On005Numeric, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 6);
        }
  
        virtual ~ModuleSafeList()
@@ -62,10 +64,6 @@ class ModuleSafeList : public Module
                return Version(1,1,0,0,VF_VENDOR,API_VERSION);
        }
  
-       void Implements(char* List)
-       {
-               List[I_OnBufferFlushed] = List[I_OnPreCommand] = List[I_OnCleanup] = List[I_OnUserQuit] = List[I_On005Numeric] = List[I_OnRehash] = 1;
-       }
 
        /*
         * OnPreCommand()
@@ -168,7 +166,7 @@ class ModuleSafeList : public Module
                if (user->GetExt("safelist_cache", ld))
                {
                        Channel* chan = NULL;
-                       long amount_sent = 0;
+                       unsigned long amount_sent = 0;
                        do
                        {
                                chan = ServerInstance->GetChannelIndex(ld->list_position);
@@ -217,7 +215,7 @@ class ModuleSafeList : public Module
                                }
                                ld->list_position++;
                        }
-                       while ((chan != NULL) && (amount_sent < (user->sendqmax / 4)));
+                       while ((chan != NULL) && (amount_sent < (user->MyClass->GetSendqMax() / 4)));
                        if (ld->list_ended)
                        {
                                user->Shrink("safelist_cache");