/************************************************************************
 *   IRC - Internet Relay Chat, modules/m_svsjoin.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 "h.h"

static char *token = TOK1_SVSJOIN;

static struct Message _msgtab[] = {
    {MSG_SVSJOIN, 0, MAXPARA, M_SLOW, 0L,
     m_unregistered, m_ignore, m_ignore, m_svsjoin, m_ignore}
};

#ifndef STATIC_MODULES

char *_version = "$Revision: 1.3 $";

void _modinit(void)
{
    mod_add_cmd(_msgtab);
    tok1_msgtab[(u_char) *token].msg = _msgtab;
}

void _moddeinit(void)
{
    mod_del_cmd(_msgtab);
    tok1_msgtab[(u_char) *token].msg = NULL;
}
#else
void m_svsjoin_init(void)
{
    mod_add_cmd(_msgtab);
    tok1_msgtab[(u_char) *token].msg = _msgtab;
}
#endif

/*
 * m_svsjoin 
 * *  - TimeMr14C
 * * parv[0] = sender
 * * parv[1] = nickname
 * * parv[2] = channel
 * * parv[3] = timestamp
 */

int m_svsjoin(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
    aClient *acptr;

    if (!IsULine(sptr) && !IsServer(sptr))
	return 0;
    if (parc < 3 || !(acptr = find_person(parv[1])))
	return 0;

    if (MyClient(acptr))
	privileged_join(acptr, cptr, parv[2]);
    else
	sendto_one_server(acptr, sptr, TOK1_SVSJOIN, "%~C :%s", acptr, parv[2]);
    return 0;

}


syntax highlighted by Code2HTML, v. 0.9.1