/* * IRC - Internet Relay Chat, modules/m_close.c * * Copyright (C) 2000-2003 TR-IRCD Development * * Copyright (C) 1990 Jarkko Oikarinen and * University of Oulu, Co Center * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "struct.h" #include "common.h" #include "sys.h" #include "numeric.h" #include "msg.h" #include "channel.h" #include "s_conf.h" #include "h.h" static struct Message _msgtab[] = { {MSG_CLOSE, 0, MAXPARA, M_SLOW, 0L, m_unregistered, m_permission, m_close, m_ignore, m_ignore} }; #ifndef STATIC_MODULES char *_version = "$Revision: 1.3 $"; void _modinit(void) { mod_add_cmd(_msgtab); } void _moddeinit(void) { mod_del_cmd(_msgtab); } #else void m_close_init(void) { mod_add_cmd(_msgtab); } #endif /* * * m_close - added by Darren Reed Jul 13 1992. */ int m_close(aClient *cptr, aClient *sptr, int parc, char *parv[]) { aClient *acptr; dlink_node *ptr, *next_ptr; int closed = 0; for (ptr = unknown_list.head; ptr; ptr = next_ptr) { next_ptr = ptr->next; acptr = ptr->data; send_me_numeric(sptr, RPL_CLOSING, get_client_name(acptr, TRUE), acptr->status); exit_client(acptr, acptr, "Oper Closing"); closed++; } logevent_call(LogSys.operevent, MSG_CLOSE, sptr, &parv, parc); send_me_numeric(sptr, RPL_CLOSEEND, closed); return 0; }