/***************************************************************************************/
/* Anope Module : global_chanreg.c : v1.0                                              */  
/* Trystan Scott Lee                                                                   */
/* trystan@nomadirc.net                                                                */ 
/*                                                                                     */
/* Anope (c) 2000-2005 Anope.org                                                       */
/*                                                                                     */ 
/* 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 1, 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.          */
/*                                                                                     */
/***************************************************************************************/

#include "module.h"

int do_changlobal(int argc, char **argv);

/**
 * Create the hook, and tell anope about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook;

    moduleAddAuthor("Trystan");
    moduleAddVersion("1.0");
    moduleSetType(THIRD);

    hook = createEventHook(EVENT_CHAN_REGISTERED, do_changlobal);
    moduleAddEventHook(hook);

    return MOD_CONT;
}

/**
 * Unload the module
 **/
void AnopeFini(void)
{

}

/**
 * Handle kick/k fantasy commands.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT or MOD_STOP
 **/
int do_changlobal(int argc, char **argv)
{
    ChannelInfo *ci;

    if (argc >= 1) {
        ci = cs_findchan(argv[0]);
        if (ci) {
            anope_cmd_global(s_ChanServ,"\2%s\2 registered the channel \2%s\2", ci->founder->display, ci->name);
        }
    }
    return MOD_CONT;
}
