#include "module.h" #define AUTHOR "SGR" #define VERSION "1.00" /* ----------------------------------------------------------- * Name : hs_autooffonlogout * Author: SGR * Date : 23/01/2004 * ----------------------------------------------------------- * Functions: m_hs_set_vhost_off * Limitations: None Known. * Tested: Unreal(3.2), Viagra * ----------------------------------------------------------- * This version has been tested on UnrealIRCd and Viagra. * * This module will automatically remove a users vhost from * them when they use the NickServ LOGOUT command. * A user who has been forcefully logged out by a services * admin will _NOT_ be affected. * * Thanks to dengel, Rob and Certus for all there support. * ----------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ /* START OF CONFIGURATION BLOCK - please read the comments :) */ /* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ /* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */ /* ---------------------------------------------------------------------- */ int m_hs_set_vhost_off(User * u); char *getvHost(char *nick); int AnopeInit(int argc, char **argv) { Command *c; c=createCommand("LOGOUT", m_hs_set_vhost_off, NULL,-1,-1,-1,-1,-1); moduleAddCommand(NICKSERV,c,MOD_TAIL); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); return MOD_CONT; } int m_hs_set_vhost_off(User * u) { if (nick_identified(u) || !getvHost(u->nick)) { return MOD_CONT; } /* ripped from hostserv.c */ #ifdef IRC_UNREAL send_cmd(s_HostServ, "SVSMODE %s -xt", u->nick); notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick); #endif #ifdef IRC_VIAGRA send_cmd(NULL, "SVSMODE %s -x", u->nick); notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick); #endif #ifdef IRC_ULTIMATE3 send_cmd(s_HostServ, "SVSMODE %s -x", u->nick); notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick); #endif return MOD_CONT; }