]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/fjoin.cpp
Use Utils->ServerUser instead of ServerInstance->FakeClient in m_spanningtree
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / fjoin.cpp
index 55c72c474e50571abe43f5e0e0ed0e03b500a087..28a922c0f56de341f52d7c8141d112dda27b87e1 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -84,8 +84,9 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        {
                time_t ourTS = chan->age;
 
-               ServerInstance->SNO->WriteToSnoMask('d', "Merge FJOIN recieved for %s, ourTS: %lu, TS: %lu, difference: %lu",
-                       chan->name.c_str(), (unsigned long)ourTS, (unsigned long)TS, (unsigned long)ourTS - (unsigned long)TS);
+               if (TS != ourTS)
+                       ServerInstance->SNO->WriteToSnoMask('d', "Merge FJOIN recieved for %s, ourTS: %lu, TS: %lu, difference: %lu",
+                               chan->name.c_str(), (unsigned long)ourTS, (unsigned long)TS, (unsigned long)(ourTS - TS));
                /* If our TS is less than theirs, we dont accept their modes */
                if (ourTS < TS)
                {
@@ -110,7 +111,6 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        /* First up, apply their modes if they won the TS war */
        if (apply_other_sides_modes)
        {
-               ServerInstance->SNO->WriteToSnoMask('d', "Applying remote modestring for %s", params[0].c_str());
                unsigned int idx = 2;
                std::vector<std::string> modelist;
 
@@ -123,7 +123,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                        modelist.push_back(params[idx]);
                }
 
-               this->ServerInstance->SendMode(modelist, this->ServerInstance->FakeClient);
+               this->ServerInstance->SendMode(modelist, Utils->ServerUser);
        }
 
        /* Now, process every 'modes,nick' pair */
@@ -168,7 +168,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                                for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
                                        modestack.Push(*x, who->nick);
 
-                               Channel::JoinUser(this->ServerInstance, who, channel.c_str(), true, "", true, TS);
+                               Channel::JoinUser(this->ServerInstance, who, channel.c_str(), true, "", route_back_again->bursting, TS);
                        }
                        else
                        {
@@ -187,11 +187,9 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
 
                while (modestack.GetStackedLine(stackresult))
                {
-                       for (size_t j = 0; j < stackresult.size(); j++)
-                       {
-                               mode_junk.push_back(stackresult[j]);
-                       }
-                       ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+                       mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
+                       ServerInstance->SendMode(mode_junk, Utils->ServerUser);
+                       mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
                }
        }
 
@@ -226,10 +224,9 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
 
                while (stack.GetStackedLine(stackresult))
                {
-                       for (size_t j = 0; j < stackresult.size(); j++)
-                               mode_junk.push_back(stackresult[j]);
-
-                       ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+                       mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
+                       ServerInstance->SendMode(mode_junk, Utils->ServerUser);
+                       mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
                }
        }
        return true;