* ---------------------------------------------------
*/
-#include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
+#include "inspircd.h"
#include "wildcard.h"
/** Holds a users m_safelist state
{
int minusers = 0, maxusers = 0;
- if (global_listing >= LimitList)
+ if (global_listing >= LimitList && !IS_OPER(user))
{
user->WriteServ("NOTICE %s :*** Server load is currently too heavy. Please try again later.", user->nick);
user->WriteServ("321 %s Channel :Users Name",user->nick);
return 1;
}
- DELETE(last_list_time);
+ delete last_list_time;
user->Shrink("safelist_last");
}
if (ld->list_ended)
{
user->Shrink("safelist_cache");
- DELETE(ld);
+ delete ld;
global_listing--;
}
}
if (ld)
{
u->Shrink("safelist_cache");
- DELETE(ld);
+ delete ld;
global_listing--;
}
time_t* last_list_time;
u->GetExt("safelist_last", last_list_time);
if (last_list_time)
{
- DELETE(last_list_time);
+ delete last_list_time;
u->Shrink("safelist_last");
}
}
};
-
-class ModuleSafeListFactory : public ModuleFactory
-{
- public:
- ModuleSafeListFactory()
- {
- }
-
- ~ModuleSafeListFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleSafeList(Me);
- }
-
-};
-
-extern "C" DllExport void * init_module( void )
-{
- return new ModuleSafeListFactory;
-}
+MODULE_INIT(ModuleSafeList)