2 * IRC - Internet Relay Chat, ircd/m_unzombie.c
3 * Copyright (C) 2011 Jan Krueger <jk@jk.gs>
5 * See file AUTHORS in IRC package for additional names of
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 1, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include "ircd_reply.h"
31 #include "ircd_string.h"
42 /** Handle an UNZOMBIE message from a server connection.
44 * \a parv has the following elements:
45 * \li \a parv[1] is the numnick of the client attaching to the zombie
46 * \li \a parv[2] is the numnick of the zombie
48 * See @ref m_functions for discussion of the arguments.
49 * @param[in] cptr Client that sent us the message.
50 * @param[in] sptr Original source of message.
51 * @param[in] parc Number of arguments.
52 * @param[in] parv Argument vector.
54 int ms_unzombie(struct Client* cptr, struct Client* sptr, int parc,
58 struct Client *victim;
61 return need_more_params(sptr, "UNZOMBIE");
64 return protocol_violation(cptr, "UNZOMBIE from non-server %s",
67 if (!(acptr = findNUser(parv[1])))
68 return 0; /* If this is colliding with a QUIT, let the QUIT win */
70 if (!(victim = findNUser(parv[2])))
74 if (!IsNotConn(victim))
75 return protocol_violation(cptr, "UNZOMBIE trying to attach to non-zombie %s",
77 assert(IsAccount(victim));
79 unzombie_client(cptr, sptr, acptr, victim);