]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cban.cpp
Update wiki links to use HTTPS and point to the correct pages.
[user/henk/code/inspircd.git] / src / modules / m_cban.cpp
index f6cdfdb88ef556283222049aa36c8f0ca2552bad..fb78e41b29cb45f9dede6dc908c219e94060c203 100644 (file)
@@ -32,7 +32,7 @@ class CBan : public XLine
 public:
        irc::string matchtext;
 
-       CBan(time_t s_time, long d, std::string src, std::string re, std::string ch)
+       CBan(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& ch)
                : XLine(s_time, d, src, re, "CBAN")
        {
                this->matchtext = ch.c_str();
@@ -147,6 +147,9 @@ class CommandCBan : public Command
 
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
+               if (IS_LOCAL(user))
+                       return ROUTE_LOCALONLY; // spanningtree will send ADDLINE
+
                return ROUTE_BROADCAST;
        }
 };
@@ -165,9 +168,9 @@ class ModuleCBan : public Module
        {
                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()