diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hybrid.c | 1831 |
1 files changed, 967 insertions, 864 deletions
diff --git a/src/hybrid.c b/src/hybrid.c index 9c2deafe2..7947173e2 100644 --- a/src/hybrid.c +++ b/src/hybrid.c @@ -73,8 +73,8 @@ IRCDVar ircd[] = { 0, /* svshold */ 0, /* time stamp on mode */ 0, /* NICKIP */ + 0, /* UMODE */ 0, /* O:LINE */ - 0, /* UMODE */ 0, /* VHOST ON NICK */ 0, /* Change RealName */ 0, /* ChanServ extra */ @@ -183,391 +183,409 @@ void anope_set_umode(User * user, int ac, char **av) opcnt--; } break; + case 'r': + if (add && !nick_identified(user)) { + send_cmd(ServerName, "SVSMODE %s -r", user->nick); + user->mode &= ~UMODE_r; + } + break; + } } +} - unsigned long umodes[128] = { - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused, Unused, Horzontal Tab */ - 0, 0, 0, /* Line Feed, Unused, Unused */ - 0, 0, 0, /* Carriage Return, Unused, Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused, Unused, Space */ - 0, 0, 0, /* ! " # */ - 0, 0, 0, /* $ % & */ - 0, 0, 0, /* ! ( ) */ - 0, 0, 0, /* * + , */ - 0, 0, 0, /* - . / */ - 0, 0, /* 0 1 */ - 0, 0, /* 2 3 */ - 0, 0, /* 4 5 */ - 0, 0, /* 6 7 */ - 0, 0, /* 8 9 */ - 0, 0, /* : ; */ - 0, 0, 0, /* < = > */ - 0, 0, /* ? @ */ - 0, 0, 0, /* A B C */ - 0, 0, 0, /* D E F */ - 0, 0, 0, /* G H I */ - 0, 0, 0, /* J K L */ - 0, 0, 0, /* M N O */ - 0, 0, 0, /* P Q R */ - 0, 0, 0, /* S T U */ - 0, 0, 0, /* V W X */ - 0, /* Y */ - 0, /* Z */ - 0, 0, 0, /* [ \ ] */ - 0, 0, 0, /* ^ _ ` */ - UMODE_a, UMODE_b, UMODE_c, /* a b c */ - UMODE_d, 0, UMODE_f, /* d e f */ - UMODE_g, 0, UMODE_i, /* g h i */ - 0, UMODE_k, UMODE_l, /* j k l */ - 0, UMODE_n, UMODE_o, /* m n o */ - 0, 0, UMODE_r, /* p q r */ - UMODE_s, 0, UMODE_u, /* s t u */ - 0, UMODE_w, UMODE_x, /* v w x */ - UMODE_y, /* y */ - UMODE_z, /* z */ - 0, 0, 0, /* { | } */ - 0, 0 /* ~ ‚ */ - }; - - - char csmodes[128] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, - 'a', /* (33) ! */ - 0, 0, 0, - 'h', - 0, 0, 0, 0, - 0, - - 'v', 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - - CMMode cmmodes[128] = { - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, /* BCD */ - {NULL}, {NULL}, {NULL}, /* EFG */ - {NULL}, /* H */ - {add_invite, del_invite}, - {NULL}, /* J */ - {NULL}, {NULL}, {NULL}, /* KLM */ - {NULL}, {NULL}, {NULL}, /* NOP */ - {NULL}, {NULL}, {NULL}, /* QRS */ - {NULL}, {NULL}, {NULL}, /* TUV */ - {NULL}, {NULL}, {NULL}, /* WXY */ - {NULL}, /* Z */ - {NULL}, {NULL}, /* (char 91 - 92) */ - {NULL}, {NULL}, {NULL}, /* (char 93 - 95) */ - {NULL}, /* ` (char 96) */ - {NULL}, /* a (char 97) */ - {add_ban, del_ban}, - {NULL}, - {NULL}, - {add_exception, del_exception}, - {NULL}, - {NULL}, - {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, - {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL} - }; - - - CBMode cbmodes[128] = { - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, - {0}, /* A */ - {0}, /* B */ - {0}, /* C */ - {0}, /* D */ - {0}, /* E */ - {0}, /* F */ - {0}, /* G */ - {0}, /* H */ - {0}, /* I */ - {0}, /* J */ - {0}, /* K */ - {0}, /* L */ - {0}, /* M */ - {0}, /* N */ - {0}, /* O */ - {0}, /* P */ - {0}, /* Q */ - {0}, - {0}, /* S */ - {0}, /* T */ - {0}, /* U */ - {0}, /* V */ - {0}, /* W */ - {0}, /* X */ - {0}, /* Y */ - {0}, /* Z */ - {0}, {0}, {0}, {0}, {0}, {0}, - {CMODE_a, 0, NULL, NULL}, - {0}, /* b */ - {0}, /* c */ - {0}, /* d */ - {0}, /* e */ - {0}, /* f */ - {0}, /* g */ - {0}, /* h */ - {CMODE_i, 0, NULL, NULL}, - {0}, /* j */ - {CMODE_k, 0, set_key, cs_set_key}, - {CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit}, - {CMODE_m, 0, NULL, NULL}, - {CMODE_n, 0, NULL, NULL}, - {0}, /* o */ - {CMODE_p, 0, NULL, NULL}, - {0}, /* q */ - {0}, - {CMODE_s, 0, NULL, NULL}, - {CMODE_t, 0, NULL, NULL}, - {0}, - {0}, /* v */ - {0}, /* w */ - {0}, /* x */ - {0}, /* y */ - {0}, /* z */ - {0}, {0}, {0}, {0} - }; - - CBModeInfo cbmodeinfos[] = { - {'a', CMODE_a, 0, NULL, NULL}, - {'i', CMODE_i, 0, NULL, NULL}, - {'k', CMODE_k, 0, get_key, cs_get_key}, - {'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit}, - {'m', CMODE_m, 0, NULL, NULL}, - {'n', CMODE_n, 0, NULL, NULL}, - {'p', CMODE_p, 0, NULL, NULL}, - {'s', CMODE_s, 0, NULL, NULL}, - {'t', CMODE_t, 0, NULL, NULL}, - {0} - }; - - - CUMode cumodes[128] = { - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, - - {0}, - - {0}, /* a */ - {0}, /* b */ - {0}, /* c */ - {0}, /* d */ - {0}, /* e */ - {0}, /* f */ - {0}, /* g */ - {CUS_HALFOP, 0, check_valid_op}, - {0}, /* i */ - {0}, /* j */ - {0}, /* k */ - {0}, /* l */ - {0}, /* m */ - {0}, /* n */ - {CUS_OP, CUF_PROTECT_BOTSERV, check_valid_op}, - {0}, /* p */ - {0}, /* q */ - {0}, /* r */ - {0}, /* s */ - {0}, /* t */ - {0}, /* u */ - {CUS_VOICE, 0, NULL}, - {0}, /* w */ - {0}, /* x */ - {0}, /* y */ - {0}, /* z */ - {0}, {0}, {0}, {0}, {0} - }; - - - - void anope_cmd_notice(char *source, char *dest, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +unsigned long umodes[128] = { + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused, Unused, Horzontal Tab */ + 0, 0, 0, /* Line Feed, Unused, Unused */ + 0, 0, 0, /* Carriage Return, Unused, Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused, Unused, Space */ + 0, 0, 0, /* ! " # */ + 0, 0, 0, /* $ % & */ + 0, 0, 0, /* ! ( ) */ + 0, 0, 0, /* * + , */ + 0, 0, 0, /* - . / */ + 0, 0, /* 0 1 */ + 0, 0, /* 2 3 */ + 0, 0, /* 4 5 */ + 0, 0, /* 6 7 */ + 0, 0, /* 8 9 */ + 0, 0, /* : ; */ + 0, 0, 0, /* < = > */ + 0, 0, /* ? @ */ + 0, 0, 0, /* A B C */ + 0, 0, 0, /* D E F */ + 0, 0, 0, /* G H I */ + 0, 0, 0, /* J K L */ + 0, 0, 0, /* M N O */ + 0, 0, 0, /* P Q R */ + 0, 0, 0, /* S T U */ + 0, 0, 0, /* V W X */ + 0, /* Y */ + 0, /* Z */ + 0, 0, 0, /* [ \ ] */ + 0, 0, 0, /* ^ _ ` */ + UMODE_a, UMODE_b, UMODE_c, /* a b c */ + UMODE_d, 0, UMODE_f, /* d e f */ + UMODE_g, 0, UMODE_i, /* g h i */ + 0, UMODE_k, UMODE_l, /* j k l */ + 0, UMODE_n, UMODE_o, /* m n o */ + 0, 0, UMODE_r, /* p q r */ + UMODE_s, 0, UMODE_u, /* s t u */ + 0, UMODE_w, UMODE_x, /* v w x */ + UMODE_y, /* y */ + UMODE_z, /* z */ + 0, 0, 0, /* { | } */ + 0, 0 /* ~ ‚ */ +}; - if (UsePrivmsg) { - anope_cmd_privmsg2(source, dest, buf); - } else { - send_cmd(source, "NOTICE %s :%s", dest, buf); - } - } - void anope_cmd_notice2(char *source, char *dest, char *msg) { - send_cmd(source, "NOTICE %s :%s", dest, msg); - } +char csmodes[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; + 0, + 'a', /* (33) ! */ + 0, 0, 0, + 'h', + 0, 0, 0, 0, + 0, - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } + 'v', 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +CMMode cmmodes[128] = { + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, /* BCD */ + {NULL}, {NULL}, {NULL}, /* EFG */ + {NULL}, /* H */ + {add_invite, del_invite}, + {NULL}, /* J */ + {NULL}, {NULL}, {NULL}, /* KLM */ + {NULL}, {NULL}, {NULL}, /* NOP */ + {NULL}, {NULL}, {NULL}, /* QRS */ + {NULL}, {NULL}, {NULL}, /* TUV */ + {NULL}, {NULL}, {NULL}, /* WXY */ + {NULL}, /* Z */ + {NULL}, {NULL}, /* (char 91 - 92) */ + {NULL}, {NULL}, {NULL}, /* (char 93 - 95) */ + {NULL}, /* ` (char 96) */ + {NULL}, /* a (char 97) */ + {add_ban, del_ban}, + {NULL}, + {NULL}, + {add_exception, del_exception}, + {NULL}, + {NULL}, + {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, + {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL} +}; + + +CBMode cbmodes[128] = { + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, + {0}, /* A */ + {0}, /* B */ + {0}, /* C */ + {0}, /* D */ + {0}, /* E */ + {0}, /* F */ + {0}, /* G */ + {0}, /* H */ + {0}, /* I */ + {0}, /* J */ + {0}, /* K */ + {0}, /* L */ + {0}, /* M */ + {0}, /* N */ + {0}, /* O */ + {0}, /* P */ + {0}, /* Q */ + {0}, + {0}, /* S */ + {0}, /* T */ + {0}, /* U */ + {0}, /* V */ + {0}, /* W */ + {0}, /* X */ + {0}, /* Y */ + {0}, /* Z */ + {0}, {0}, {0}, {0}, {0}, {0}, + {CMODE_a, 0, NULL, NULL}, + {0}, /* b */ + {0}, /* c */ + {0}, /* d */ + {0}, /* e */ + {0}, /* f */ + {0}, /* g */ + {0}, /* h */ + {CMODE_i, 0, NULL, NULL}, + {0}, /* j */ + {CMODE_k, 0, set_key, cs_set_key}, + {CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit}, + {CMODE_m, 0, NULL, NULL}, + {CMODE_n, 0, NULL, NULL}, + {0}, /* o */ + {CMODE_p, 0, NULL, NULL}, + {0}, /* q */ + {0}, + {CMODE_s, 0, NULL, NULL}, + {CMODE_t, 0, NULL, NULL}, + {0}, + {0}, /* v */ + {0}, /* w */ + {0}, /* x */ + {0}, /* y */ + {0}, /* z */ + {0}, {0}, {0}, {0} +}; + +CBModeInfo cbmodeinfos[] = { + {'a', CMODE_a, 0, NULL, NULL}, + {'i', CMODE_i, 0, NULL, NULL}, + {'k', CMODE_k, 0, get_key, cs_get_key}, + {'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit}, + {'m', CMODE_m, 0, NULL, NULL}, + {'n', CMODE_n, 0, NULL, NULL}, + {'p', CMODE_p, 0, NULL, NULL}, + {'s', CMODE_s, 0, NULL, NULL}, + {'t', CMODE_t, 0, NULL, NULL}, + {0} +}; + + +CUMode cumodes[128] = { + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, + + {0}, + + {0}, /* a */ + {0}, /* b */ + {0}, /* c */ + {0}, /* d */ + {0}, /* e */ + {0}, /* f */ + {0}, /* g */ + {CUS_HALFOP, 0, check_valid_op}, + {0}, /* i */ + {0}, /* j */ + {0}, /* k */ + {0}, /* l */ + {0}, /* m */ + {0}, /* n */ + {CUS_OP, CUF_PROTECT_BOTSERV, check_valid_op}, + {0}, /* p */ + {0}, /* q */ + {0}, /* r */ + {0}, /* s */ + {0}, /* t */ + {0}, /* u */ + {CUS_VOICE, 0, NULL}, + {0}, /* w */ + {0}, /* x */ + {0}, /* y */ + {0}, /* z */ + {0}, {0}, {0}, {0}, {0} +}; - send_cmd(source, "PRIVMSG %s :%s", dest, buf); - } - void anope_cmd_privmsg2(char *source, char *dest, char *msg) { - send_cmd(source, "PRIVMSG %s :%s", dest, msg); + +void anope_cmd_notice(char *source, char *dest, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; + + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } - void anope_cmd_serv_notice(char *source, char *dest, char *msg) { - send_cmd(source, "NOTICE $$%s :%s", dest, msg); + if (UsePrivmsg) { + anope_cmd_privmsg2(source, dest, buf); + } else { + send_cmd(source, "NOTICE %s :%s", dest, buf); } +} - void anope_cmd_serv_privmsg(char *source, char *dest, char *msg) { - send_cmd(source, "PRIVMSG $$%s :%s", dest, msg); +void anope_cmd_notice2(char *source, char *dest, char *msg) +{ + send_cmd(source, "NOTICE %s :%s", dest, msg); +} + +void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; + + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } + send_cmd(source, "PRIVMSG %s :%s", dest, buf); +} - void anope_cmd_global(char *source, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; +void anope_cmd_privmsg2(char *source, char *dest, char *msg) +{ + send_cmd(source, "PRIVMSG %s :%s", dest, msg); +} - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_serv_notice(char *source, char *dest, char *msg) +{ + send_cmd(source, "NOTICE $$%s :%s", dest, msg); +} - send_cmd(source ? source : ServerName, "OPERWALL :%s", buf); - } +void anope_cmd_serv_privmsg(char *source, char *dest, char *msg) +{ + send_cmd(source, "PRIVMSG $$%s :%s", dest, msg); +} - int anope_event_sjoin(char *source, int ac, char **av) { - do_sjoin(source, ac, av); - return MOD_CONT; - } +void anope_cmd_global(char *source, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - int anope_event_nick(char *source, int ac, char **av) { - if (ac != 2) { - User *user = do_nick(source, av[0], av[4], av[5], av[6], av[7], - strtoul(av[2], NULL, 10), 0, 0, NULL, - NULL); - if (user) - anope_set_umode(user, 1, &av[3]); - } else { - do_nick(source, av[0], NULL, NULL, NULL, NULL, - strtoul(av[1], NULL, 10), 0, 0, NULL, NULL); - } - return MOD_CONT; + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } - int anope_event_topic(char *source, int ac, char **av) { - if (ac == 4) { - do_topic(source, ac, av); - } else { - Channel *c = findchan(av[0]); - time_t topic_time = time(NULL); - - if (!c) { - alog("channel: TOPIC %s for nonexistent channel %s", - merge_args(ac - 1, av + 1), av[0]); - return MOD_CONT; - } + send_cmd(source ? source : ServerName, "OPERWALL :%s", buf); +} - if (check_topiclock(c, topic_time)) - return MOD_CONT; - if (c->topic) { - free(c->topic); - c->topic = NULL; - } - if (ac > 1 && *av[1]) - c->topic = sstrdup(av[1]); +int anope_event_sjoin(char *source, int ac, char **av) +{ + do_sjoin(source, ac, av); + return MOD_CONT; +} - strscpy(c->topic_setter, source, sizeof(c->topic_setter)); - c->topic_time = topic_time; +int anope_event_nick(char *source, int ac, char **av) +{ + if (ac != 2) { + User *user = do_nick(source, av[0], av[4], av[5], av[6], av[7], + strtoul(av[2], NULL, 10), 0, 0, NULL, NULL); + if (user) + anope_set_umode(user, 1, &av[3]); + } else { + do_nick(source, av[0], NULL, NULL, NULL, NULL, + strtoul(av[1], NULL, 10), 0, 0, NULL, NULL); + } + return MOD_CONT; +} - record_topic(av[0]); +int anope_event_topic(char *source, int ac, char **av) +{ + if (ac == 4) { + do_topic(source, ac, av); + } else { + Channel *c = findchan(av[0]); + time_t topic_time = time(NULL); + + if (!c) { + alog("channel: TOPIC %s for nonexistent channel %s", + merge_args(ac - 1, av + 1), av[0]); + return MOD_CONT; } - return MOD_CONT; - } - int anope_event_436(char *source, int ac, char **av) { - if (ac < 1) + if (check_topiclock(c, topic_time)) return MOD_CONT; - m_nickcoll(av[0]); - return MOD_CONT; + if (c->topic) { + free(c->topic); + c->topic = NULL; + } + if (ac > 1 && *av[1]) + c->topic = sstrdup(av[1]); + + strscpy(c->topic_setter, source, sizeof(c->topic_setter)); + c->topic_time = topic_time; + + record_topic(av[0]); } + return MOD_CONT; +} + +int anope_event_436(char *source, int ac, char **av) +{ + if (ac < 1) + return MOD_CONT; + + m_nickcoll(av[0]); + return MOD_CONT; +} /* *INDENT-OFF* */ @@ -619,56 +637,69 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ - void anope_cmd_sqline(char *mask, char *reason) { +void anope_cmd_sqline(char *mask, char *reason) +{ - } - void anope_cmd_unsgline(char *mask) { +} +void anope_cmd_unsgline(char *mask) +{ /* Does not support */ - } +} - void anope_cmd_unszline(char *mask) { - /* Does not support */ - } - void anope_cmd_szline(char *mask, char *reason) { - /* Does not support */ - } +void anope_cmd_unszline(char *mask) +{ + /* Does not support */ +} +void anope_cmd_szline(char *mask, char *reason) +{ + /* Does not support */ +} - void anope_cmd_svsnoop(char *server, int set) { - /* does not support */ - } +void anope_cmd_svsnoop(char *server, int set) +{ + /* does not support */ +} - void anope_cmd_svsadmin(char *server, int set) { - anope_cmd_svsnoop(server, set); - } +void anope_cmd_svsadmin(char *server, int set) +{ + anope_cmd_svsnoop(server, set); +} - void anope_cmd_sgline(char *mask, char *reason) { - /* does not support */ - } +void anope_cmd_sgline(char *mask, char *reason) +{ + /* does not support */ +} - void anope_cmd_remove_akill(char *user, char *host) { - /* does not support */ - } +void anope_cmd_remove_akill(char *user, char *host) +{ + /* does not support */ +} - void anope_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) { - send_cmd(whosets, "TOPIC %s :%s", chan, topic); - } +void anope_cmd_topic(char *whosets, char *chan, char *whosetit, + char *topic, time_t when) +{ + send_cmd(whosets, "TOPIC %s :%s", chan, topic); +} - void anope_cmd_vhost_off(char *nick) { - /* does not support vhosting */ - } +void anope_cmd_vhost_off(char *nick) +{ + /* does not support vhosting */ +} - void anope_cmd_vhost_on(char *nick, char *vIdent, char *vhost) { - /* does not support vhosting */ - } +void anope_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +{ + /* does not support vhosting */ +} - void anope_cmd_unsqline(char *user) { - /* Hybrid does not support SQLINEs */ - } +void anope_cmd_unsqline(char *user) +{ + /* Hybrid does not support SQLINEs */ +} - void anope_cmd_join(char *user, char *channel, time_t chantime) { - send_cmd(NULL, "SJOIN %ld %s + :%s", time(NULL), channel, user); - } +void anope_cmd_join(char *user, char *channel, time_t chantime) +{ + send_cmd(NULL, "SJOIN %ld %s + :%s", time(NULL), channel, user); +} /* oper: the nick of the oper performing the kline @@ -679,54 +710,59 @@ host: the 'host' portion of the kline reason: the reason for the kline. */ - void anope_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) { - send_cmd(s_OperServ, "KLINE * %ld %s %s :%s", - (expires - (long) time(NULL)), user, host, reason); - } - - void anope_cmd_svskill(char *source, char *user, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; +void anope_cmd_akill(char *user, char *host, char *who, time_t when, + time_t expires, char *reason) +{ + send_cmd(s_OperServ, "KLINE * %ld %s %s :%s", + (expires - (long) time(NULL)), user, host, reason); +} - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_svskill(char *source, char *user, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - if (!source || !user) { - return; - } + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; + } - send_cmd(source, "KILL %s :%s", user, buf); + if (!source || !user) { + return; } + send_cmd(source, "KILL %s :%s", user, buf); +} - void anope_cmd_svsmode(User * u, int ac, char **av) { - /* Hybrid does not support SVSMODE */ - } - void anope_cmd_connect(int servernum) { - if (servernum == 1) - anope_cmd_pass(RemotePassword); - else if (servernum == 2) - anope_cmd_pass(RemotePassword2); - else if (servernum == 3) - anope_cmd_pass(RemotePassword3); - - anope_cmd_capab(); - anope_cmd_server(ServerName, 1, ServerDesc); - anope_cmd_svinfo(); - } +void anope_cmd_svsmode(User * u, int ac, char **av) +{ + /* Hybrid does not support SVSMODE */ +} - void anope_cmd_svsinfo() { - /* not used */ - } +void anope_cmd_connect(int servernum) +{ + if (servernum == 1) + anope_cmd_pass(RemotePassword); + else if (servernum == 2) + anope_cmd_pass(RemotePassword2); + else if (servernum == 3) + anope_cmd_pass(RemotePassword3); + + anope_cmd_capab(); + anope_cmd_server(ServerName, 1, ServerDesc); + anope_cmd_svinfo(); +} + +void anope_cmd_svsinfo() +{ + /* not used */ +} /* * SVINFO @@ -736,9 +772,10 @@ reason: the reason for the kline. * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ - void anope_cmd_svinfo() { - send_cmd(NULL, "SVINFO 5 5 0 :%ld", time(NULL)); - } +void anope_cmd_svinfo() +{ + send_cmd(NULL, "SVINFO 5 5 0 :%ld", time(NULL)); +} /* CAPAB */ /* @@ -761,547 +798,603 @@ reason: the reason for the kline. PARA - supports invite broadcasting for +p ENCAP - ? */ - void anope_cmd_capab() { - send_cmd(NULL, - "CAPAB :QS EX CHW IE EOB KLN GLN HOPS HUB AOPS KNOCK TBURST PARA"); - } +void anope_cmd_capab() +{ + send_cmd(NULL, + "CAPAB :QS EX CHW IE EOB KLN GLN HOPS HUB AOPS KNOCK TBURST PARA"); +} /* PASS */ - void anope_cmd_pass(char *pass) { - send_cmd(NULL, "PASS %s :TS", pass); - } +void anope_cmd_pass(char *pass) +{ + send_cmd(NULL, "PASS %s :TS", pass); +} /* SERVER name hop descript */ - void anope_cmd_server(char *servname, int hop, char *descript) { - send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); - } - - void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) { - EnforceQlinedNick(nick, s_BotServ); - send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), - modes, user, host, ServerName, real); +void anope_cmd_server(char *servname, int hop, char *descript) +{ + send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); +} - } +void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real, + char *modes) +{ + EnforceQlinedNick(nick, s_BotServ); + send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), + modes, user, host, ServerName, real); - void anope_cmd_part(char *nick, char *chan, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; +} - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } +void anope_cmd_part(char *nick, char *chan, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - if (buf) { - send_cmd(nick, "PART %s :%s", chan, buf); - } else { - send_cmd(nick, "PART %s", chan); - } + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } - int anope_event_ping(char *source, int ac, char **av) { - if (ac < 1) - return MOD_CONT; - anope_cmd_pong(ac > 1 ? av[1] : ServerName, av[0]); - return MOD_CONT; + if (buf) { + send_cmd(nick, "PART %s :%s", chan, buf); + } else { + send_cmd(nick, "PART %s", chan); } +} - int anope_event_away(char *source, int ac, char **av) { - if (ac < 1) - return MOD_CONT; - - if (!source) { - return MOD_CONT; - } - m_away(source, av[0]); +int anope_event_ping(char *source, int ac, char **av) +{ + if (ac < 1) return MOD_CONT; - } - - int anope_event_kill(char *source, int ac, char **av) { - if (ac != 2) - return MOD_CONT; + anope_cmd_pong(ac > 1 ? av[1] : ServerName, av[0]); + return MOD_CONT; +} - m_kill(av[0], av[1]); +int anope_event_away(char *source, int ac, char **av) +{ + if (ac < 1) return MOD_CONT; - } - int anope_event_kick(char *source, int ac, char **av) { - if (ac != 3) - return MOD_CONT; - do_kick(source, ac, av); + if (!source) { return MOD_CONT; } + m_away(source, av[0]); + return MOD_CONT; +} - int anope_event_eob(char *source, int ac, char **av) { - Server *s; - s = findserver(servlist, source); - if (s) { - s->sync = 1; - } +int anope_event_kill(char *source, int ac, char **av) +{ + if (ac != 2) return MOD_CONT; - } - - void anope_cmd_eob() { - send_cmd(ServerName, "EOB"); - } + m_kill(av[0], av[1]); + return MOD_CONT; +} - int anope_event_join(char *source, int ac, char **av) { - if (ac != 1) - return MOD_CONT; - do_join(source, ac, av); +int anope_event_kick(char *source, int ac, char **av) +{ + if (ac != 3) return MOD_CONT; + do_kick(source, ac, av); + return MOD_CONT; +} + +int anope_event_eob(char *source, int ac, char **av) +{ + Server *s; + s = findserver(servlist, source); + if (s) { + s->sync = 1; } + return MOD_CONT; +} + +void anope_cmd_eob() +{ + send_cmd(ServerName, "EOB"); +} - int anope_event_motd(char *source, int ac, char **av) { - if (!source) { - return MOD_CONT; - } - m_motd(source); +int anope_event_join(char *source, int ac, char **av) +{ + if (ac != 1) return MOD_CONT; - } + do_join(source, ac, av); + return MOD_CONT; +} - int anope_event_privmsg(char *source, int ac, char **av) { - if (ac != 2) - return MOD_CONT; - m_privmsg(source, av[0], av[1]); +int anope_event_motd(char *source, int ac, char **av) +{ + if (!source) { return MOD_CONT; } - int anope_event_part(char *source, int ac, char **av) { - if (ac < 1 || ac > 2) - return MOD_CONT; - do_part(source, ac, av); + m_motd(source); + return MOD_CONT; +} + +int anope_event_privmsg(char *source, int ac, char **av) +{ + if (ac != 2) return MOD_CONT; - } + m_privmsg(source, av[0], av[1]); + return MOD_CONT; +} - int anope_event_whois(char *source, int ac, char **av) { - if (source && ac >= 1) { - m_whois(source, av[0]); - } +int anope_event_part(char *source, int ac, char **av) +{ + if (ac < 1 || ac > 2) return MOD_CONT; + do_part(source, ac, av); + return MOD_CONT; +} + +int anope_event_whois(char *source, int ac, char **av) +{ + if (source && ac >= 1) { + m_whois(source, av[0]); } + return MOD_CONT; +} /* EVENT: SERVER */ - int anope_event_server(char *source, int ac, char **av) { - char *uplink; +int anope_event_server(char *source, int ac, char **av) +{ + char *uplink; - if (!stricmp(av[1], "1")) - uplink = sstrdup(av[0]); - do_server(source, av[0], av[1], av[2], NULL); - return MOD_CONT; - } + if (!stricmp(av[1], "1")) + uplink = sstrdup(av[0]); + do_server(source, av[0], av[1], av[2], NULL); + return MOD_CONT; +} - int anope_event_squit(char *source, int ac, char **av) { - if (ac != 2) - return MOD_CONT; - do_squit(source, ac, av); +int anope_event_squit(char *source, int ac, char **av) +{ + if (ac != 2) return MOD_CONT; - } + do_squit(source, ac, av); + return MOD_CONT; +} - int anope_event_quit(char *source, int ac, char **av) { - if (ac != 1) - return MOD_CONT; - do_quit(source, ac, av); +int anope_event_quit(char *source, int ac, char **av) +{ + if (ac != 1) return MOD_CONT; - } + do_quit(source, ac, av); + return MOD_CONT; +} - void anope_cmd_372(char *source, char *msg) { - send_cmd(ServerName, "372 %s :- %s", source, msg); - } +void anope_cmd_372(char *source, char *msg) +{ + send_cmd(ServerName, "372 %s :- %s", source, msg); +} - void anope_cmd_372_error(char *source) { - send_cmd(ServerName, "372 %s :- MOTD file not found! Please " - "contact your IRC administrator.", source); - } +void anope_cmd_372_error(char *source) +{ + send_cmd(ServerName, "372 %s :- MOTD file not found! Please " + "contact your IRC administrator.", source); +} - void anope_cmd_375(char *source) { - send_cmd(ServerName, "375 %s :- %s Message of the Day", - source, ServerName); - } +void anope_cmd_375(char *source) +{ + send_cmd(ServerName, "375 %s :- %s Message of the Day", + source, ServerName); +} - void anope_cmd_376(char *source) { - send_cmd(ServerName, "376 %s :End of /MOTD command.", source); - } +void anope_cmd_376(char *source) +{ + send_cmd(ServerName, "376 %s :End of /MOTD command.", source); +} /* 391 */ - void anope_cmd_391(char *source, char *timestr) { - if (!timestr) { - return; - } - send_cmd(NULL, "391 :%s %s :%s", source, ServerName, timestr); +void anope_cmd_391(char *source, char *timestr) +{ + if (!timestr) { + return; } + send_cmd(NULL, "391 :%s %s :%s", source, ServerName, timestr); +} /* 250 */ - void anope_cmd_250(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_250(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(NULL, "250 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } + if (!buf) { + return; + } + + send_cmd(NULL, "250 %s ", buf); +} /* 307 */ - void anope_cmd_307(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_307(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(ServerName, "307 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } + send_cmd(ServerName, "307 %s ", buf); +} + /* 311 */ - void anope_cmd_311(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_311(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(ServerName, "311 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } + send_cmd(ServerName, "311 %s ", buf); +} + /* 312 */ - void anope_cmd_312(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_312(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(ServerName, "312 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } + send_cmd(ServerName, "312 %s ", buf); +} + /* 317 */ - void anope_cmd_317(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_317(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(ServerName, "317 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } + send_cmd(ServerName, "317 %s ", buf); +} + /* 219 */ - void anope_cmd_219(char *source, char *letter) { - if (!source) { - return; - } +void anope_cmd_219(char *source, char *letter) +{ + if (!source) { + return; + } - if (letter) { - send_cmd(NULL, "219 %s %c :End of /STATS report.", source, - *letter); - } else { - send_cmd(NULL, "219 %s l :End of /STATS report.", source); - } + if (letter) { + send_cmd(NULL, "219 %s %c :End of /STATS report.", source, + *letter); + } else { + send_cmd(NULL, "219 %s l :End of /STATS report.", source); } +} /* 401 */ - void anope_cmd_401(char *source, char *who) { - if (!source || !who) { - return; - } - send_cmd(ServerName, "401 %s %s :No such service.", source, who); +void anope_cmd_401(char *source, char *who) +{ + if (!source || !who) { + return; } + send_cmd(ServerName, "401 %s %s :No such service.", source, who); +} /* 318 */ - void anope_cmd_318(char *source, char *who) { - if (!source || !who) { - return; - } - - send_cmd(ServerName, "318 %s %s :End of /WHOIS list.", source, - who); +void anope_cmd_318(char *source, char *who) +{ + if (!source || !who) { + return; } + send_cmd(ServerName, "318 %s %s :End of /WHOIS list.", source, who); +} + /* 242 */ - void anope_cmd_242(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_242(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(NULL, "242 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } + if (!buf) { + return; + } + + send_cmd(NULL, "242 %s ", buf); +} /* 243 */ - void anope_cmd_243(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_243(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(NULL, "243 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } + if (!buf) { + return; + } + + send_cmd(NULL, "243 %s ", buf); +} /* 211 */ - void anope_cmd_211(const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_211(const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(NULL, "211 %s ", buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + if (!buf) { + return; } - void anope_cmd_mode(char *source, char *dest, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; + send_cmd(NULL, "211 %s ", buf); +} - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_mode(char *source, char *dest, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(source, "MODE %s %s", dest, buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } - - void anope_cmd_nick(char *nick, char *name, char *mode) { - EnforceQlinedNick(nick, NULL); - send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), - mode, ServiceUser, ServiceHost, ServerName, (name)); + if (!buf) { + return; } - void anope_cmd_kick(char *source, char *chan, char *user, - const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; + send_cmd(source, "MODE %s %s", dest, buf); +} - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } +void anope_cmd_nick(char *nick, char *name, char *mode) +{ + EnforceQlinedNick(nick, NULL); + send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), mode, + ServiceUser, ServiceHost, ServerName, (name)); +} - if (buf) { - send_cmd(source, "KICK %s %s :%s", chan, user, buf); - } else { - send_cmd(source, "KICK %s %s", chan, user); - } +void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt, + ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; + + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } - void anope_cmd_notice_ops(char *source, char *dest, const char *fmt, - ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; + if (buf) { + send_cmd(source, "KICK %s %s :%s", chan, user, buf); + } else { + send_cmd(source, "KICK %s %s", chan, user); + } +} - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - if (!buf) { - return; - } +void anope_cmd_notice_ops(char *source, char *dest, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - send_cmd(NULL, "NOTICE @%s :%s", dest, buf); + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } - - void anope_cmd_bot_chan_mode(char *nick, char *chan) { - anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); + if (!buf) { + return; } + send_cmd(NULL, "NOTICE @%s :%s", dest, buf); +} + +void anope_cmd_bot_chan_mode(char *nick, char *chan) +{ + anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); +} + /* QUIT */ - void anope_cmd_quit(char *source, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } +void anope_cmd_quit(char *source, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + *buf = '\0'; - if (buf) { - send_cmd(source, "QUIT :%s", buf); - } else { - send_cmd(source, "QUIT"); - } + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); } -/* PONG */ - void anope_cmd_pong(char *servname, char *who) { - send_cmd(servname, "PONG %s", who); + if (buf) { + send_cmd(source, "QUIT :%s", buf); + } else { + send_cmd(source, "QUIT"); } +} -/* INVITE */ - void anope_cmd_invite(char *source, char *chan, char *nick) { - if (!source || !chan || !nick) { - return; - } +/* PONG */ +void anope_cmd_pong(char *servname, char *who) +{ + send_cmd(servname, "PONG %s", who); +} - send_cmd(source, "INVITE %s %s", nick, chan); +/* INVITE */ +void anope_cmd_invite(char *source, char *chan, char *nick) +{ + if (!source || !chan || !nick) { + return; } -/* SQUIT */ - void anope_cmd_squit(char *servname, char *message) { - if (!servname || !message) { - return; - } + send_cmd(source, "INVITE %s %s", nick, chan); +} - send_cmd(servname, "SQUIT %s :%s", servname, message); +/* SQUIT */ +void anope_cmd_squit(char *servname, char *message) +{ + if (!servname || !message) { + return; } - int anope_event_mode(char *source, int ac, char **av) { - if (ac < 2) - return MOD_CONT; + send_cmd(servname, "SQUIT %s :%s", servname, message); +} - if (*av[0] == '#' || *av[0] == '&') { - do_cmode(source, ac, av); - } else { - do_umode(source, ac, av); - } +int anope_event_mode(char *source, int ac, char **av) +{ + if (ac < 2) return MOD_CONT; - } - void anope_cmd_351(char *source) { - send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s -- %s", - source, version_number, ServerName, ircd->name, - version_flags, version_build); + if (*av[0] == '#' || *av[0] == '&') { + do_cmode(source, ac, av); + } else { + do_umode(source, ac, av); } + return MOD_CONT; +} + +void anope_cmd_351(char *source) +{ + send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s -- %s", + source, version_number, ServerName, ircd->name, version_flags, + version_build); +} /* Event: PROTOCTL */ - int anope_event_capab(char *source, int ac, char **av) { - capab_parse(ac, av); - return MOD_CONT; - } +int anope_event_capab(char *source, int ac, char **av) +{ + capab_parse(ac, av); + return MOD_CONT; +} /* SVSHOLD - set */ - void anope_cmd_svshold(char *nick) { - /* Not supported by this IRCD */ - } +void anope_cmd_svshold(char *nick) +{ + /* Not supported by this IRCD */ +} /* SVSHOLD - release */ - void anope_cmd_release_svshold(char *nick) { - /* Not Supported by this IRCD */ - } +void anope_cmd_release_svshold(char *nick) +{ + /* Not Supported by this IRCD */ +} /* SVSNICK */ - void anope_cmd_svsnick(char *nick, char *newnick, time_t when) { - /* Not Supported by this IRCD */ - } +void anope_cmd_svsnick(char *nick, char *newnick, time_t when) +{ + /* Not Supported by this IRCD */ +} - void anope_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) { - send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), - modes, user, host, ServerName, real); - } +void anope_cmd_guest_nick(char *nick, char *user, char *host, char *real, + char *modes) +{ + send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, time(NULL), + modes, user, host, ServerName, real); +} - void anope_cmd_svso(char *source, char *nick, char *flag) { - /* Not Supported by this IRCD */ - } +void anope_cmd_svso(char *source, char *nick, char *flag) +{ + /* Not Supported by this IRCD */ +} - void anope_cmd_unban(char *name, char *nick) { - /* Not Supported by this IRCD */ - } +void anope_cmd_unban(char *name, char *nick) +{ + /* Not Supported by this IRCD */ +} /* SVSMODE +d */ /* sent if svid is something weird */ - void anope_cmd_svid_umode(char *nick, time_t ts) { - send_cmd(ServerName, "SVSMODE %s +d 1", nick); - } +void anope_cmd_svid_umode(char *nick, time_t ts) +{ + send_cmd(ServerName, "SVSMODE %s +d 1", nick); +} /* SVSMODE +d */ /* nc_change was = 1, and there is no na->status */ - void anope_cmd_nc_change(User * u) { - /* not used */ - } +void anope_cmd_nc_change(User * u) +{ + /* not used */ +} /* SVSMODE +d */ - void anope_cmd_svid_umode2(User * u, char *ts) { - /* not used */ - } +void anope_cmd_svid_umode2(User * u, char *ts) +{ + /* not used */ +} - void anope_cmd_svid_umode3(User * u, char *ts) { - /* not used */ - } +void anope_cmd_svid_umode3(User * u, char *ts) +{ + /* not used */ +} /* NICK <newnick> */ - void anope_cmd_chg_nick(char *oldnick, char *newnick) { - if (!oldnick || !newnick) { - return; - } - - send_cmd(oldnick, "NICK %s", newnick); +void anope_cmd_chg_nick(char *oldnick, char *newnick) +{ + if (!oldnick || !newnick) { + return; } + send_cmd(oldnick, "NICK %s", newnick); +} + /* * SVINFO * parv[0] = sender prefix @@ -1310,52 +1403,62 @@ reason: the reason for the kline. * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ - int anope_event_svinfo(char *source, int ac, char **av) { - /* currently not used but removes the message : unknown message from server */ - return MOD_CONT; - } +int anope_event_svinfo(char *source, int ac, char **av) +{ + /* currently not used but removes the message : unknown message from server */ + return MOD_CONT; +} - int anope_event_pass(char *source, int ac, char **av) { - /* currently not used but removes the message : unknown message from server */ - return MOD_CONT; - } +int anope_event_pass(char *source, int ac, char **av) +{ + /* currently not used but removes the message : unknown message from server */ + return MOD_CONT; +} - void anope_cmd_svsjoin(char *source, char *nick, char *chan) { - /* Not Supported by this IRCD */ - } +void anope_cmd_svsjoin(char *source, char *nick, char *chan) +{ + /* Not Supported by this IRCD */ +} - void anope_cmd_svspart(char *source, char *nick, char *chan) { - /* Not Supported by this IRCD */ - } +void anope_cmd_svspart(char *source, char *nick, char *chan) +{ + /* Not Supported by this IRCD */ +} - void anope_cmd_swhois(char *source, char *who, char *mask) { - /* not supported */ - } +void anope_cmd_swhois(char *source, char *who, char *mask) +{ + /* not supported */ +} - int anope_event_notice(char *source, int ac, char **av) { - return MOD_CONT; - } +int anope_event_notice(char *source, int ac, char **av) +{ + return MOD_CONT; +} - int anope_event_admin(char *source, int ac, char **av) { - return MOD_CONT; - } +int anope_event_admin(char *source, int ac, char **av) +{ + return MOD_CONT; +} - int anope_event_invite(char *source, int ac, char **av) { - return MOD_CONT; - } +int anope_event_invite(char *source, int ac, char **av) +{ + return MOD_CONT; +} - int anope_flood_mode_check(char *value) { - return 0; - } +int anope_flood_mode_check(char *value) +{ + return 0; +} - int anope_event_error(char *source, int ac, char **av) { - if (ac >= 1) { - if (debug) { - alog("ERROR: %s", av[0]); - } +int anope_event_error(char *source, int ac, char **av) +{ + if (ac >= 1) { + if (debug) { + alog("ERROR: %s", av[0]); } - return MOD_CONT; } + return MOD_CONT; +} |