]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge pull request #179 from attilamolnar/insp20+desyncfix
authorRobin Burchell <viroteck@viroteck.net>
Fri, 1 Jun 2012 08:07:36 +0000 (01:07 -0700)
committerRobin Burchell <viroteck@viroteck.net>
Fri, 1 Jun 2012 08:07:36 +0000 (01:07 -0700)
[2.0] Fix desyncs caused by m_autoop and broken spanningtree routing logic

src/modules/m_autoop.cpp
src/modules/m_spanningtree/postcommand.cpp

index f239773e95a1ce3c4a061a3e30dcfb767c462e12..40a57d7c3cf7024c2ffd53ba4d508f573716601f 100644 (file)
@@ -119,7 +119,7 @@ public:
                        for(std::string::size_type i = modeline.length(); i > 1; --i) // we use "i > 1" instead of "i" so we skip the +
                                modechange.push_back(memb->user->nick);
                        if(modechange.size() >= 3)
-                               ServerInstance->SendMode(modechange,ServerInstance->FakeClient);
+                               ServerInstance->SendGlobalMode(modechange, ServerInstance->FakeClient);
                }
        }
 
index 6afe8e2c9c1fe808adf9176a7c26037b0a8a1206..b08f60925007da5be065c65758a16eed062a153b 100644 (file)
@@ -52,15 +52,15 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, const std::string &
 
        if (routing.type == ROUTE_TYPE_LOCALONLY)
        {
-               Module* srcmodule = thiscmd->creator;
-               Version ver = srcmodule->GetVersion();
+               /* Broadcast when it's a core command with the default route descriptor and the source is a
+                * remote user or a remote server
+                */
 
-               if ((ver.Flags & VF_CORE) && !IS_LOCAL(user))
-                       routing = ROUTE_BROADCAST;
-               else
-                       return;
-               if (IS_SERVER(user) && user != ServerInstance->FakeClient)
+               Version ver = thiscmd->creator->GetVersion();
+               if ((!(ver.Flags & VF_CORE)) || (IS_LOCAL(user)) || (IS_SERVER(user) == ServerInstance->FakeClient))
                        return;
+
+               routing = ROUTE_BROADCAST;
        }
        else if (routing.type == ROUTE_TYPE_OPT_BCAST)
        {