X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree.cpp;h=77d09ae3e5d5abb6f1ed17b53e6b34549985d1ea;hb=09c2980424577f2aef5a7ffb645c47ccce1e4cc9;hp=05f5a4ab92b8ca14a2cc8c4a0a63e986b838dfd1;hpb=67cf8f594aa36edfca40511d245626dae258999a;p=user%2Fhenk%2Fcode%2Finspircd.git 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]);