X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree.cpp;h=1e908f07b139ce063d5dfccfa4b50358e811c58b;hb=922d4ebf7a27a6577d6b4f91e0f42ccdfa989455;hp=d3f8e9a21b89ff11eb55c72b0039d0bfa18a252f;hpb=f82cc8dd39fe97a9e91226b2aa892dcf036a5c0c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index d3f8e9a21..1e908f07b 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -330,7 +330,7 @@ class TreeServer : public classbase userrec* a = (userrec*)*n; log(DEBUG,"Kill %s fd=%d",a->nick,a->fd); if (!IS_LOCAL(a)) - kill_link(a,reason_s); + userrec::QuitUser(a,reason_s); } return time_to_die.size(); } @@ -1338,11 +1338,11 @@ class TreeSocket : public InspSocket userrec* user = Srv->FindNick(source); if (!user) { - WriteChannelWithServ(source.c_str(), c, "TOPIC %s :%s", c->name, c->topic); + c->WriteChannelWithServ(source.c_str(), "TOPIC %s :%s", c->name, c->topic); } else { - WriteChannel(c, user, "TOPIC %s :%s", c->name, c->topic); + c->WriteChannel(user, "TOPIC %s :%s", c->name, c->topic); nsource = user->server; } /* all done, send it on its way */ @@ -1430,7 +1430,7 @@ class TreeSocket : public InspSocket who = Srv->FindNick(usr); if (who) { - Srv->JoinUserToChannel(who,channel,key); + chanrec::JoinUser(who, channel.c_str(), true, key); if (modectr >= (MAXMODES-1)) { /* theres a mode for this user. push them onto the mode queue, and flush it @@ -2014,7 +2014,11 @@ class TreeSocket : public InspSocket /* This is not required as one is sent in OnUserPostNick below */ //DoOneToMany(u->nick,"NICK",par); - Srv->ChangeUserNick(u,params[1]); + if (!u->ForceNickChange(params[1].c_str())) + { + userrec::QuitUser(u, "Nickname collision"); + return true; + } u->age = atoi(params[2].c_str()); } } @@ -2030,7 +2034,7 @@ class TreeSocket : public InspSocket if (u) { - Srv->JoinUserToChannel(u,params[1],""); + chanrec::JoinUser(u, params[1].c_str(), false); DoOneToAllButSender(prefix,"SVSJOIN",params,prefix); } return true; @@ -2078,7 +2082,7 @@ class TreeSocket : public InspSocket params[1] = ":" + params[1]; DoOneToAllButSender(prefix,"KILL",params,sourceserv); ::Write(who->fd, ":%s KILL %s :%s (%s)", sourceserv.c_str(), who->nick, sourceserv.c_str(), reason.c_str()); - Srv->QuitUser(who,reason); + userrec::QuitUser(who,reason); } return true; } @@ -2965,11 +2969,11 @@ class TreeSocket : public InspSocket p.push_back(prefix); p.push_back("Nickname collision"); DoOneToMany(Srv->GetServerName(),"KILL",p); - Srv->QuitUser(x,"Nickname collision ("+prefix+" -> "+params[0]+")"); + userrec::QuitUser(x,"Nickname collision ("+prefix+" -> "+params[0]+")"); userrec* y = Srv->FindNick(prefix); if (y) { - Srv->QuitUser(y,"Nickname collision"); + userrec::QuitUser(y,"Nickname collision"); } return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); }