X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_securelist.cpp;h=fcb2a4e94f74f05ca9c6960bfd140ea3febc4107;hb=fd2eb26472bcc0b7b144f40523ff820cba82f574;hp=cedc3f5227456eb994ff0a95b4ee198a47430af8;hpb=bb8724e9bfa109b464139901f8ef71ddae6b04fe;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index cedc3f522..fcb2a4e94 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -20,25 +20,23 @@ using namespace std; #include "channels.h" #include "modules.h" #include "helperfuncs.h" -#include "message.h" #include - +#include "inspircd.h" + extern time_t TIME; /* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */ + +extern InspIRCd* ServerInstance; class ModuleSecureList : public Module { private: Server *Srv; - ListTimer* MyTimer; public: ModuleSecureList(Server* Me) : Module::Module(Me) { Srv = Me; - - MyTimer = new ListTimer(1,Srv); - Srv->AddTimer(MyTimer); } virtual ~ModuleSecureList() @@ -59,7 +57,7 @@ class ModuleSecureList : public Module * OnPreCommand() * Intercept the LIST command. */ - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) @@ -67,12 +65,12 @@ class ModuleSecureList : public Module if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper)) { - WriteServ(user->fd,"NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick); + user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick); /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't * receive these numerics whenever they send LIST, so give them an empty LIST to mull over. */ - WriteServ(u->fd,"321 %s Channel :Users Name",user->nick); - WriteServ(u->fd,"323 %s :End of channel list.",user->nick); + user->WriteServ("321 %s Channel :Users Name",user->nick); + user->WriteServ("323 %s :End of channel list.",user->nick); return 1; } return 0; @@ -85,7 +83,7 @@ class ModuleSecureList : public Module virtual Priority Prioritize() { - return Srv->PriorityBefore("m_safelist.so"); + return (Priority)ServerInstance->PriorityBefore("m_safelist.so"); } };