diff options
| author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-10-06 03:48:18 +0000 |
|---|---|---|
| committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-10-06 03:48:18 +0000 |
| commit | c9cb911e14f97fbdd4286893c05b6b5cd176e780 (patch) | |
| tree | c3de757b42e893179e26e26259db591f220ffb6d /src | |
| parent | bf36b3740f9092ce9f1e66499b0788e1702f89c2 (diff) | |
BUILD : 1.7.5 (374) BUGS : N/A NOTES : One last time for hybrid.c
git-svn-id: svn://svn.anope.org/anope/trunk@374 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@244 5417fbe8-f217-4b02-8779-1006273d7864
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(sour |
