/* this is a fun module without any useful function */ /* it makes the "DevNull"-Serv respond to any message */ /* with a pre-defined Message */ /* (made by a really, really bored person) */ #define MY_MESSAGE "Can't write to /dev/null: device full" #include "module.h" #define AUTHOR "Jens 'DukePyrolator' Voss" #define VERSION "1.0 stable" int my_privmsg(char *source, int ac, char **av); int AnopeInit(int argc, char **argv) { Message *msg = NULL; int status; if (UseTokens && ircd->token) { msg = createMessage("!", my_privmsg); } else { msg = createMessage("PRIVMSG", my_privmsg); } status = moduleAddMessage(msg, MOD_HEAD); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); return MOD_CONT; } int my_privmsg(char *source, int ac, char **av) { User *u; /* dont make it crash */ if (ac != 2) /* should never happen */ return MOD_CONT; if (!(u = finduser(source))) { /* non user source */ return MOD_CONT; } if ((stricmp(av[0], s_DevNull)) == 0) { notice_user(s_DevNull, u, MY_MESSAGE); } return MOD_CONT; }