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();
}
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 */
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
/* 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());
}
}
if (u)
{
- Srv->JoinUserToChannel(u,params[1],"");
+ chanrec::JoinUser(u, params[1].c_str(), false);
DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
}
return true;
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;
}
chanrec* chan = Srv->FindChannel(params[0]);
if (user && chan)
{
- server_kick_channel(user,chan,(char*)params[2].c_str(),false);
+ if (!chan->ServerKickUser(user, params[2].c_str(), false))
+ /* Yikes, the channels gone! */
+ delete chan;
}
}
if (this->InboundServerName != "")
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);
}