X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree.cpp;h=ca25fe4a689938d2b09bed10e10cfcbf55f66043;hb=f73cbbafe1bbad627e359078988ce570fbf5d0d9;hp=da617c8717bc96691acf0e77556e4905061e092d;hpb=0fff50fdd786eb1a3ca0ab69cbaa73dac21f385d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index da617c871..ca25fe4a6 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1179,7 +1179,7 @@ class TreeSocket : public InspSocket for (chan_hash::iterator c = chanlist.begin(); c != chanlist.end(); c++) { SendFJoins(Current, c->second); - snprintf(data,MAXBUF,":%s FMODE %s +%s",Srv->GetServerName().c_str(),c->second->name,chanmodes(c->second)); + snprintf(data,MAXBUF,":%s FMODE %s +%s",Srv->GetServerName().c_str(),c->second->name,chanmodes(c->second,true)); this->WriteLine(data); if (*c->second->topic) { @@ -2126,6 +2126,32 @@ class TreeSocket : public InspSocket } if (who) { + if ((command == "NICK") && (params.size() > 0)) + { + /* On nick messages, check that the nick doesnt + * already exist here. If it does, kill their copy, + * and our copy. + */ + userrec* x = Srv->FindNick(params[0]); + if (x) + { + std::deque p; + p.push_back(params[0]); + p.push_back("Nickname collision ("+prefix+" -> "+params[0]+")"); + DoOneToMany(Srv->GetServerName(),"KILL",p); + p.clear(); + p.push_back(prefix); + p.push_back("KILL "+prefix+" :Nickname collision"); + DoOneToMany(Srv->GetServerName(),"KILL",p); + Srv->QuitUser(x,"Nickname collision ("+prefix+" -> "+params[0]+")"); + userrec* y = Srv->FindNick(prefix); + if (y) + { + Srv->QuitUser(y,"Nickname collision"); + } + return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); + } + } // its a user target = who->server; char* strparams[127]; @@ -3259,7 +3285,7 @@ class ModuleSpanningTree : public Module if (params->size() < 3) return; (*params)[2] = ":" + (*params)[2]; - DoOneToMany(Srv->GetServerName(),"METADATA ",*params); + DoOneToMany(Srv->GetServerName(),"METADATA",*params); } }