From 09c2980424577f2aef5a7ffb645c47ccce1e4cc9 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Sep 2006 15:54:47 +0000 Subject: This needs some testing. Reversal of FJOIN behaviour, so that rather than the winning side removing the modes of the losing side's channel, the losing side removes its own status modes when it encounters the first FJOIN, and affirms them using FMODE so that the other servers know what it did. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5317 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 54 ++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 05f5a4ab9..77d09ae3e 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1546,7 +1546,23 @@ class TreeSocket : public InspSocket ourTS = us->age; } - Instance->Log(DEBUG,"FJOIN detected, our TS=%lu, their TS=%lu",ourTS,TS); + /* XXX: PAY ATTENTION: + * In 1.1, if they have the newer channel, we immediately clear + * all status modes from our users. We then accept their modes. + * If WE have the newer channel its the other side's job to do this. + * Note that this causes the losing server to send out confirming + * FMODE lines. + */ + if ((ourTS > TS) || (this->Instance->ULine(who->server))) + { + Instance->Log(DEBUG,"FJOIN detected, our TS=%lu, their TS=%lu",ourTS,TS); + std::deque param_list; + us->age = TS; + ourTS = TS; + param_list.push_back(chan->name); + Instance->Log(DEBUG,"REMOVE ALL STATUS MODES FROM OUR USERS *NOW*"); + this->RemoveStatus(Instance->Config->ServerName, param_list); + } irc::tokenstream users(params[2]); std::string item = "*"; @@ -1611,25 +1627,6 @@ class TreeSocket : public InspSocket ourTS = TS; } } - else - { - Instance->Log(DEBUG,"Their channel newer than ours, bouncing their modes"); - /* bouncy bouncy! */ - std::deque params; - /* modes are now being UNSET... */ - *mode_users[1] = '-'; - for (unsigned int x = 0; x < modectr; x++) - { - if (x == 1) - { - params.push_back(ConvToStr(us->age)); - } - params.push_back(mode_users[x]); - - } - // tell everyone to bounce the modes. bad modes, bad! - DoOneToMany(this->Instance->Config->ServerName,"FMODE",params); - } strcpy(mode_users[1],"+"); for (unsigned int f = 2; f < modectr; f++) free(mode_users[f]); @@ -1638,7 +1635,7 @@ class TreeSocket : public InspSocket } else { - Instance->Log(SPARSE,"Warning! Invalid user %s in FJOIN to channel %s IGNORED", who->nick, channel.c_str()); + Instance->Log(SPARSE,"Warning! Invalid user in FJOIN to channel %s IGNORED", channel.c_str()); continue; } } @@ -1659,21 +1656,6 @@ class TreeSocket : public InspSocket ourTS = TS; } } - else - { - Instance->Log(DEBUG,"Their channel newer than ours, bouncing their modes"); - std::deque params; - *mode_users[1] = '-'; - for (unsigned int x = 0; x < modectr; x++) - { - if (x == 1) - { - params.push_back(ConvToStr(us->age)); - } - params.push_back(mode_users[x]); - } - DoOneToMany(this->Instance->Config->ServerName,"FMODE",params); - } for (unsigned int f = 2; f < modectr; f++) free(mode_users[f]); -- cgit v1.2.3