]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_banredirect.cpp
Add sanity checks to the ssl modules so that theres no possibility of an out of range...
[user/henk/code/inspircd.git] / src / modules / m_banredirect.cpp
index 3697e995f53b6cd2502694a7b0a2218a34ef74b1..9ac440d5e8ef6b4bd15236c28662280a1ce88c12 100644 (file)
  */
 
 #include "inspircd.h"
-#include "mode.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "u_listmode.h"
 
 /* $ModDesc: Allows an extended ban (+b) syntax redirecting banned users to another channel */
@@ -225,8 +221,6 @@ class ModuleBanRedirect : public Module
                                irc::modestacker modestack(false);
                                StringDeque stackresult;
                                const char* mode_junk[MAXMODES+2];
-                               userrec* myhorriblefakeuser = new userrec(ServerInstance);
-                               myhorriblefakeuser->SetFd(FD_MAGIC_NUMBER);
                                
                                mode_junk[0] = chan->name;
                                
@@ -248,10 +242,9 @@ class ModuleBanRedirect : public Module
                                                mode_junk[i+1] = stackresult[i].c_str();
                                        }
                                        
-                                       ServerInstance->SendMode(mode_junk, stackresult.size() + 1, myhorriblefakeuser);
+                                       ServerInstance->SendMode(mode_junk, stackresult.size() + 1, ServerInstance->FakeClient);
                                }
                                
-                               DELETE(myhorriblefakeuser);
                                DELETE(redirects);
                                chan->Shrink("banredirects");
                        }
@@ -260,7 +253,7 @@ class ModuleBanRedirect : public Module
 
        virtual void OnRehash(userrec* user, const std::string &param)
        {
-               ExceptionModule = ServerInstance->FindModule("m_banexception.so");
+               ExceptionModule = ServerInstance->Modules->Find("m_banexception.so");
        }
 
        virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
@@ -302,7 +295,7 @@ class ModuleBanRedirect : public Module
                                                /* tell them they're banned and are being transferred */
                                                chanrec* destchan = ServerInstance->FindChan(redir->targetchan);
                                                
-                                               if(destchan && ServerInstance->FindModule("m_redirect.so") && destchan->IsModeSet('L') && destchan->limit && (destchan->GetUserCounter() >= destchan->limit))
+                                               if(destchan && ServerInstance->Modules->Find("m_redirect.so") && destchan->IsModeSet('L') && destchan->limit && (destchan->GetUserCounter() >= destchan->limit))
                                                {
                                                        user->WriteServ("474 %s %s :Cannot join channel (You are banned)", user->nick, chan->name);
                                                        return 1;
@@ -336,7 +329,7 @@ class ModuleBanRedirect : public Module
        
        Priority Prioritize()
        {
-               return (Priority)ServerInstance->PriorityBefore("m_banexception.so");
+               return (Priority)ServerInstance->Modules->PriorityBefore("m_banexception.so");
        }
 };