diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-24 15:54:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-24 15:54:47 +0000 |
commit | 09c2980424577f2aef5a7ffb645c47ccce1e4cc9 (patch) | |
tree | aaf5538c051f823acf49e3c788682df381796e25 /src | |
parent | 67cf8f594aa36edfca40511d245626dae258999a (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 54 |
1 files changed, 18 insertions, 36 deletions
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<std::string> 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<std::string> 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<std::string> 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]); |