]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
m_spanningtree Fix crash when connecting to a remote server that has the same name...
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index 5e13f109005d7de5eb2a197513167f1bd588b020..21959e40069abcbc1e83af27d1bd6eb1d6a2fa89 100644 (file)
@@ -108,8 +108,8 @@ class CommandShun : public Command
 
                std::string target = parameters[0];
                
-               User *find = ServerInstance->FindNick(target.c_str());
-               if (find)
+               User *find = ServerInstance->FindNick(target);
+               if ((find) && (find->registered == REG_ALL))
                        target = std::string("*!*@") + find->GetIPString();
 
                if (parameters.size() == 1)
@@ -168,6 +168,9 @@ class CommandShun : 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;
        }
 };
@@ -188,7 +191,7 @@ class ModuleShun : public Module
        void init()
        {
                ServerInstance->XLines->RegisterFactory(&f);
-               ServerInstance->AddCommand(&cmd);
+               ServerInstance->Modules->AddService(cmd);
 
                Implementation eventlist[] = { I_OnStats, I_OnPreCommand, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));