]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cban.cpp
m_spanningtree Fix crash when connecting to a remote server that has the same name...
[user/henk/code/inspircd.git] / src / modules / m_cban.cpp
index 0157a4addc87e7376930a16d0249e73d347bbbeb..c779f02dfcdc7ba3304bd26d155cbca0298116b0 100644 (file)
@@ -147,7 +147,10 @@ class CommandCBan : public Command
 
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
-               return ROUTE_LOCALONLY;
+               if (IS_LOCAL(user))
+                       return ROUTE_LOCALONLY; // spanningtree will send ADDLINE
+
+               return ROUTE_BROADCAST;
        }
 };
 
@@ -158,12 +161,16 @@ class ModuleCBan : public Module
 
  public:
        ModuleCBan() : mycommand(this)
+       {
+       }
+
+       void init()
        {
                ServerInstance->XLines->RegisterFactory(&f);
 
-               ServerInstance->AddCommand(&mycommand);
+               ServerInstance->Modules->AddService(mycommand);
                Implementation eventlist[] = { I_OnUserPreJoin, I_OnStats };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        virtual ~ModuleCBan()