/*---------------------------------------------------------------------------------------- * Name: cs_join_notice * Author: Jens 'DukePyrolator' Voss * * Version: 0.1 * * --------------------------------------------------------------------------------------- * Supported IRCd: all * Requires: Anope 1.8 *---------------------------------------------------------------------------------------- * * If you find bugs, please send me a Mail or contact me on irc.anope.org #anope * here you can find the latest version: http://dev.anope.de/modules_1.8/cs_join_notice * *--------------------------------------------------------------------------------------- * Changelog: * * v0.1 04/10/2013 - first release * *----------------------------------------------------------------------------------------*/ #define AUTHOR "Jens 'DukePyrolator' Voss " #define VERSION "0.1" #include "module.h" #include /* comma separated list of users who get a notice */ #define H_LIST "DukePyrolator,cd" /* name of the helpchannel, only one channel allowed */ #define H_CHAN "#help" /* message */ #define H_MESSAGE "%s just joined %s." int do_on_join(int ac, char **av); int AnopeInit(int argc, char **argv) { Command *c = NULL; EvtHook *hook; int status = 0; hook = createEventHook(EVENT_JOIN_CHANNEL, do_on_join); status = moduleAddEventHook(hook); if (status != MOD_ERR_OK) { alog("[cs_accessfounder] unable to bind to EVENT_JOIN_CHANNEL error [%d]", status); return MOD_STOP; } moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); moduleSetType(THIRD); return MOD_CONT; } int do_on_join(int ac, char **av) { User *u; Channel *c = NULL; struct u_chaninfolist *uc; if (!stricmp(av[0], EVENT_START)) { if (!stricmp(av[2],H_CHAN)) { if (!(u = finduser(av[1]))) return MOD_CONT; notice(s_OperServ, H_LIST, H_MESSAGE, u->nick, H_CHAN); } } return MOD_CONT; }