-bool Server::PseudoToUser(userrec* alive, userrec* zombie, const std::string &message)
-{
- log(DEBUG,"PseudoToUser");
- zombie->fd = alive->fd;
- FOREACH_MOD(I_OnUserQuit,OnUserQuit(alive,message));
- alive->fd = FD_MAGIC_NUMBER;
- alive->FlushWriteBuf();
- alive->ClearBuffer();
- // save these for later
- std::string oldnick = alive->nick;
- std::string oldhost = alive->host;
- std::string oldident = alive->ident;
- kill_link(alive,message.c_str());
- if (find(local_users.begin(),local_users.end(),alive) != local_users.end())
- {
- local_users.erase(find(local_users.begin(),local_users.end(),alive));
- log(DEBUG,"Delete local user");
- }
- // Fix by brain - cant write the user until their fd table entry is updated
- fd_ref_table[zombie->fd] = zombie;
- Write(zombie->fd,":%s!%s@%s NICK %s",oldnick.c_str(),oldident.c_str(),oldhost.c_str(),zombie->nick);
- for (std::vector<ucrec*>::const_iterator i = zombie->chans.begin(); i != zombie->chans.end(); i++)
- {
- if (((ucrec*)(*i))->channel != NULL)
- {
- chanrec* Ptr = ((ucrec*)(*i))->channel;
- WriteFrom(zombie->fd,zombie,"JOIN %s",Ptr->name);
- if (Ptr->topicset)
- {
- WriteServ(zombie->fd,"332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic);
- WriteServ(zombie->fd,"333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset);
- }
- userlist(zombie,Ptr);
- WriteServ(zombie->fd,"366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name);
- }
- }
- if ((find(local_users.begin(),local_users.end(),zombie) == local_users.end()) && (zombie->fd != FD_MAGIC_NUMBER))
- local_users.push_back(zombie);
-
- return true;
-}
-
-void Server::AddGLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask)
-{
- add_gline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
- apply_lines(APPLY_GLINES);
-}
-
-void Server::AddQLine(long duration, const std::string &source, const std::string &reason, const std::string &nickname)