diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 15 | ||||
| -rw-r--r-- | src/actions.c | 163 | ||||
| -rw-r--r-- | src/bahamut.c | 1299 | ||||
| -rw-r--r-- | src/botserv.c | 237 | ||||
| -rw-r--r-- | src/channels.c | 648 | ||||
| -rw-r--r-- | src/chanserv.c | 939 | ||||
| -rw-r--r-- | src/commands.c | 18 | ||||
| -rw-r--r-- | src/datafiles.c | 11 | ||||
| -rw-r--r-- | src/dreamforge.c | 1123 | ||||
| -rw-r--r-- | src/hostserv.c | 157 | ||||
| -rw-r--r-- | src/hybrid.c | 1154 | ||||
| -rw-r--r-- | src/init.c | 207 | ||||
| -rw-r--r-- | src/language.c | 3 | ||||
| -rw-r--r-- | src/log.c | 5 | ||||
| -rw-r--r-- | src/main.c | 41 | ||||
| -rw-r--r-- | src/messages.c | 1203 | ||||
| -rw-r--r-- | src/misc.c | 2 | ||||
| -rw-r--r-- | src/modules.c | 6 | ||||
| -rw-r--r-- | src/modules/ircd_catserv.c | 2 | ||||
| -rw-r--r-- | src/mysql.c | 31 | ||||
| -rw-r--r-- | src/news.c | 4 | ||||
| -rw-r--r-- | src/nickserv.c | 350 | ||||
| -rw-r--r-- | src/operserv.c | 680 | ||||
| -rw-r--r-- | src/proxy.c | 36 | ||||
| -rw-r--r-- | src/ptlink.c | 1217 | ||||
| -rw-r--r-- | src/rageircd.c | 1273 | ||||
| -rw-r--r-- | src/send.c | 118 | ||||
| -rw-r--r-- | src/servers.c | 167 | ||||
| -rw-r--r-- | src/sessions.c | 30 | ||||
| -rw-r--r-- | src/ultimate2.c | 1318 | ||||
| -rw-r--r-- | src/ultimate3.c | 1427 | ||||
| -rw-r--r-- | src/unreal31.c | 1340 | ||||
| -rw-r--r-- | src/unreal32.c | 1434 | ||||
| -rw-r--r-- | src/users.c | 519 | ||||
| -rw-r--r-- | src/viagra.c | 1349 |
35 files changed, 14781 insertions, 3745 deletions
diff --git a/src/Makefile b/src/Makefile index aa2303268..3465c8e47 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,13 +3,16 @@ RDB_OBJ = $(RDB:.c=.o) OBJS = actions.o botserv.o channels.o chanserv.o commands.o compat.o converter.o \ config.o datafiles.o encrypt.o helpserv.o hostserv.o init.o language.o list.o log.o mail.o main.o \ memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \ - process.o protocol.o proxy.o send.o servers.o sessions.o slist.o sockutil.o \ - timeout.o users.o \ + process.o proxy.o send.o servers.o sessions.o slist.o sockutil.o \ + timeout.o users.o dreamforge.o bahamut.o unreal31.o ultimate2.o ultimate3.o \ + hybrid.o ptlink.o viagra.o rageircd.o unreal32.o \ $(VSNPRINTF_O) $(RDB_OBJ) $(MYSQL_OBJ) SRCS = actions.c botserv.c channels.c chanserv.c commands.c compat.c converter.c \ config.c datafiles.c encrypt.c helpserv.c hostserv.c init.c language.c list.c log.c mail.c main.c \ memory.c memoserv.c messages.c misc.c modules.c news.c nickserv.c operserv.c \ - process.c protocol.c proxy.c send.c servers.c sessions.c slist.c sockutil.c \ + process.c proxy.c send.c servers.c sessions.c slist.c sockutil.c \ + dreamforge.c bahamut.c unreal31.c ultimate2.c ultimate3.c \ + hybrid.c ptlink.c viagra.c rageircd.c unreal32.c \ timeout.c users.c \ $(VSNPRINTF_C) $(RDB) $(MYSQL) @@ -17,7 +20,11 @@ INCLUDES = ../include/commands.h ../include/defs.h ../include/language.h \ ../include/pseudo.h ../include/sysconf.h ../include/config.h \ ../include/encrypt.h ../include/messages.h ../include/services.h \ ../include/timeout.h ../include/datafiles.h ../include/extern.h \ - ../include/modules.h ../include/slist.h ../include/version.h + ../include/modules.h ../include/slist.h ../include/version.h \ + ../include/dreamforge.h ../include/bahamut.h ../include/ultimate2.h \ + ../include/ultimate3.h ../include/hybrid.h ../include/ptlink.h ../include/unreal31.h \ + ../include/viagra.h ../include/rageircd.h ../include/unreal32.h + MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'LDFLAGS=${LDFLAGS}' 'BINDEST=${BINDEST}' 'INSTALL=${INSTALL}' \ diff --git a/src/actions.c b/src/actions.c index cb7fd0851..a863eae76 100644 --- a/src/actions.c +++ b/src/actions.c @@ -38,43 +38,12 @@ void bad_password(User * u) /*************************************************************************/ -void change_user_mode(User * u, char *modes, char *arg) -{ -#ifndef IRC_HYBRID - int ac = 1; - char *av[2]; - - av[0] = modes; - if (arg) { - av[1] = arg; - ac++; - } -#ifdef IRC_BAHAMUT - send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, u->timestamp, - av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); -#else - send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0], - (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); -#endif - set_umode(u, ac, av); -#endif -} - -/*************************************************************************/ - /* Remove a user from the IRC network. `source' is the nick which should * generate the kill, or NULL for a server-generated kill. */ -void kill_user(const char *source, const char *user, const char *reason) +void kill_user(char *source, char *user, char *reason) { -#ifdef IRC_BAHAMUT - /* Bahamut uses SVSKILL as a better way to kill users. It sends back - * a QUIT message that Anope uses to clean up after the kill is done. - */ - send_cmd(NULL, "SVSKILL %s :%s", user, reason); -#else - char *av[2]; char buf[BUFSIZE]; if (!user || !*user) @@ -83,13 +52,131 @@ void kill_user(const char *source, const char *user, const char *reason) source = ServerName; if (!reason) reason = ""; + snprintf(buf, sizeof(buf), "%s (%s)", source, reason); - av[0] = sstrdup(user); - av[1] = buf; - send_cmd(source, "KILL %s :%s", user, av[1]); - do_kill(source, 2, av); - free(av[0]); -#endif + + anope_cmd_svskill(source, user, buf); + + if (!ircd->quitonkill) { + do_kill(user, buf); + } +} + +/*************************************************************************/ + +void sqline(char *mask, char *reason) +{ + if (ircd->chansqline) { + if (*mask == '#') { + int i; + Channel *c, *next; + + char *av[3]; + struct c_userlist *cu, *cunext; + + anope_cmd_sqline(mask, reason); + + for (i = 0; i < 1024; i++) { + for (c = chanlist[i]; c; c = next) { + next = c->next; + + if (!match_wild_nocase(mask, c->name)) + continue; + + for (cu = c->users; cu; cu = cunext) { + cunext = cu->next; + + if (is_oper(cu->user)) + continue; + + av[0] = c->name; + av[1] = cu->user->nick; + av[2] = reason; + anope_cmd_kick(s_OperServ, av[0], av[1], + "Q-Lined: %s", av[2]); + do_kick(s_ChanServ, 3, av); + } + } + } + } else { + anope_cmd_sqline(mask, reason); + } + } else { + anope_cmd_sqline(mask, reason); + } +} + +/*************************************************************************/ + +void common_unban(ChannelInfo * ci, char *nick) +{ + int count, i; + char *av[3], **bans; + User *u; + + if (!ci || !ci->c || !ci->bi || !nick) + return; + if (!(u = finduser(nick))) + return; + + if (ircd->svsmode_unban) { + anope_cmd_unban(ci->name, nick); + } else { + av[0] = ci->name; + av[1] = sstrdup("-b"); + count = ci->c->bancount; + bans = scalloc(sizeof(char *) * count, 1); + memcpy(bans, ci->c->bans, sizeof(char *) * count); + for (i = 0; i < count; i++) { + if (match_usermask(bans[i], u)) { + anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]); + av[2] = bans[i]; + do_cmode(ci->bi->nick, 3, av); + } + } + free(bans); + free(av[1]); + } +} + +/*************************************************************************/ + +void common_svsmode(User * u, char *modes, char *arg) +{ + int ac = 1; + char *av[2]; + + av[0] = modes; + if (arg) { + av[1] = arg; + ac++; + } + anope_cmd_svsmode(u, ac, av); + anope_set_umode(u, ac, av); +} + +/*************************************************************************/ + +char *common_get_vhost(User * u) +{ + if (u->mode & ircd->vhostmode) { + return u->vhost; + } else { + return u->host; + } } /*************************************************************************/ + +char *common_get_vident(User * u) +{ + if (u->mode & ircd->vhostmode) { + if (u->vident) { + return u->vident; + } else { + return u->username; + } + } else { + return u->username; + } +} diff --git a/src/bahamut.c b/src/bahamut.c new file mode 100644 index 000000000..b605924d7 --- /dev/null +++ b/src/bahamut.c @@ -0,0 +1,1299 @@ +/* Bahamut functions + * + * (C) 2003 Anope Team + * Contact us at info@anope.org + * + * Please read COPYING and README for furhter details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + +/*************************************************************************/ + +#include "services.h" +#include "pseudo.h" + +#ifdef IRC_BAHAMUT + +const char version_protocol[] = "BahamutIRCd 1.4.*/1.8.*"; + +IRCDVar ircd[] = { + {"BahamutIRCd 1.4.*/1.8.*", /* ircd name */ + "+o", /* nickserv mode */ + "+o", /* chanserv mode */ + "+o", /* memoserv mode */ + "+", /* hostserv mode */ + "+io", /* operserv mode */ + "+o", /* botserv mode */ + "+h", /* helpserv mode */ + "+i", /* Dev/Null mode */ + "+io", /* Global mode */ + "+o", /* nickserv alias mode */ + "+o", /* chanserv alias mode */ + "+o", /* memoserv alias mode */ + "+", /* hostserv alias mode */ + "+io", /* operserv alias mode */ + "+o", /* botserv alias mode */ + "+h", /* helpserv alias mode */ + "+i", /* Dev/Null alias mode */ + "+io", /* Global alias mode */ + "+", /* Used by BotServ Bots */ + 2, /* Chan Max Symbols */ + "-ciklmnpstOR", /* Modes to Remove */ + "+o", /* Channel Umode used by Botserv bots */ + 1, /* SVSNICK */ + 0, /* Vhost */ + 0, /* Has Owner */ + NULL, /* Mode to set for an owner */ + NULL, /* Mode to unset for an owner */ + "+rd", /* Mode On Reg */ + "-r+d", /* Mode on UnReg */ + "+d", /* Mode on Nick Change */ + 1, /* Supports SGlines */ + 1, /* Supports SQlines */ + 1, /* Supports SZlines */ + 0, /* Supports Halfop +h */ + 3, /* Number of server args */ + 0, /* Join 2 Set */ + 0, /* Join 2 Message */ + 1, /* Has exceptions +e */ + 0, /* TS Topic Forward */ + 0, /* TS Topci Backward */ + 0, /* Protected Umode */ + 0, /* Has Admin */ + 1, /* Chan SQlines */ + 1, /* Quit on Kill */ + 1, /* SVSMODE unban */ + 0, /* Has Protect */ + 0, /* Reverse */ + 1, /* Chan Reg */ + CMODE_r, /* Channel Mode */ + 0, /* vidents */ + 1, /* svshold */ + 1, /* time stamp on mode */ + 1, /* NICKIP */ + 0, /* UMODE */ + 0, /* O:LINE */ + 0, /* VHOST ON NICK */ + 0, /* Change RealName */ + 0, /* ChanServ extra */ + 0, /* No Knock */ + 0, /* Admin Only */ + DEFAULT_MLOCK, /* Default MLOCK */ + 0, /* Vhost Mode */ + 0, /* +f */ + 0, /* +L */ + 0, /* Mode */ + 0, /* Mode */ + 1, + + } + , + {NULL} +}; + +IRCDCAPAB ircdcap[] = { + { + CAPAB_NOQUIT, /* NOQUIT */ + CAPAB_TSMODE, /* TSMODE */ + CAPAB_UNCONNECT, /* UNCONNECT */ + 0, /* NICKIP */ + 0, /* SJOIN */ + 0, /* ZIP */ + CAPAB_BURST, /* BURST */ + 0, /* TS5 */ + 0, /* TS3 */ + CAPAB_DKEY, /* DKEY */ + 0, /* PT4 */ + 0, /* SCS */ + 0, /* QS */ + 0, /* UID */ + 0, /* KNOCK */ + 0, /* CLIENT */ + 0, /* IPV6 */ + 0, /* SSJ5 */ + 0, /* SN2 */ + 0, /* TOKEN */ + 0, /* VHOST */ + 0, /* SSJ3 */ + 0, /* NICK2 */ + 0, /* UMODE2 */ + 0, /* VL */ + 0, /* TLKEXT */ + 0, /* DODKEY */ + CAPAB_DOZIP /* DOZIP */ + } +}; + + +void anope_set_umode(User * user, int ac, char **av) +{ + int add = 1; /* 1 if adding modes, 0 if deleting */ + char *modes = av[0]; + + ac--; + + if (debug) + alog("debug: Changing mode for %s to %s", user->nick, modes); + + while (*modes) { + + add ? (user->mode |= umodes[(int) *modes]) : (user->mode &= + ~umodes[(int) + *modes]); + + switch (*modes++) { + case '+': + add = 1; + break; + case '-': + add = 0; + break; + case 'a': + if (add && !is_services_admin(user)) { + send_cmd(ServerName, "SVSMODE %s -a", user->nick); + user->mode &= ~UMODE_a; + } + break; + case 'd': + if (ac == 0) { + alog("user: umode +d with no parameter (?) for user %s", + user->nick); + break; + } + + ac--; + av++; + user->svid = strtoul(*av, NULL, 0); + break; + case 'o': + if (add) { + opcnt++; + + if (WallOper) + anope_cmd_global(s_OperServ, + "\2%s\2 is now an IRC operator.", + user->nick); + display_news(user, NEWS_OPER); + + } else { + 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + 0, + UMODE_R, + 0, 0, 0, 0, 0, 0, 0, + 0, + 0, 0, 0, 0, 0, + 0, UMODE_a, 0, 0, 0, 0, 0, + 0, + UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o, + 0, + 0, UMODE_r, 0, 0, 0, 0, UMODE_w, + 0, + 0, + 0, + 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, + 0, + 0, 0, 0, + 0, + 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}, {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}, + {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 */ + {CMODE_M}, + {0}, /* N */ + {CMODE_O, CBM_NO_USER_MLOCK, NULL, NULL}, + {0}, /* P */ + {0}, /* Q */ + {CMODE_R, 0, NULL, NULL}, /* R */ + {0}, /* S */ + {0}, /* T */ + {0}, /* U */ + {0}, /* V */ + {0}, /* W */ + {0}, /* X */ + {0}, /* Y */ + {0}, /* Z */ + {0}, {0}, {0}, {0}, {0}, {0}, + {0}, /* a */ + {0}, /* b */ + {CMODE_c, 0, NULL, NULL}, + {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 */ + {CMODE_r, CBM_NO_MLOCK, NULL, NULL}, + {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[] = { + {'c', CMODE_c, 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}, + {'r', CMODE_r, 0, NULL, NULL}, + {'s', CMODE_s, 0, NULL, NULL}, + {'t', CMODE_t, 0, NULL, NULL}, + {'M', CMODE_M, 0, NULL, NULL}, + {'O', CMODE_O, 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 */ + {0}, /* h */ + {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_mode(char *source, char *dest, const char *fmt, ...) +{ + va_list args; + char buf[BUFSIZE]; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + + if (ircdcap->tsmode) { + if (uplink_capab & ircdcap->tsmode) { + send_cmd(source, "MODE %s 0 %s", dest, buf); + } else { + send_cmd(source, "MODE %s %s", dest, buf); + } + } else { + send_cmd(source, "MODE %s %s", dest, buf); + } +} + +/* SVSHOLD - set */ +void anope_cmd_svshold(char *nick) +{ + send_cmd(ServerName, "SVSHOLD %s %d :%s", nick, NSReleaseTimeout, + "Being held for registered user"); +} + +/* SVSHOLD - release */ +void anope_cmd_relase_svshold(char *nick) +{ + send_cmd(ServerName, "SVSHOLD %s 0", nick); +} + +/* SVSMODE -b */ +void anope_cmd_unban(char *name, char *nick) +{ + send_cmd(ServerName, "SVSMODE %s -b %s", name, nick); +} + +void anope_cmd_bot_chan_mode(char *nick, char *chan) +{ + anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); +} + +/* EVENT: SJOIN */ +int anope_event_sjoin(char *source, int ac, char **av) +{ + do_sjoin(source, ac, av); + return MOD_CONT; +} + +/* +** NICK - new +** source = NULL +** parv[0] = nickname +** parv[1] = hopcount +** parv[2] = timestamp +** parv[3] = modes +** parv[4] = username +** parv[5] = hostname +** parv[6] = server +** parv[7] = servicestamp +** parv[8] = IP +** parv[9] = info +** NICK - change +** source = oldnick +** parv[0] = new nickname +** parv[1] = hopcount +*/ +int anope_event_nick(char *source, int ac, char **av) +{ + User *user; + + if (ac != 2) { + user = do_nick(source, av[0], av[4], av[5], av[6], av[9], + strtoul(av[2], NULL, 10), strtoul(av[7], NULL, 0), + strtoul(av[8], NULL, 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; +} + +/* EVENT : CAPAB */ +int anope_event_capab(char *source, int ac, char **av) +{ + capab_parse(ac, av); + return MOD_CONT; +} + +/* EVENT : OS */ +int anope_event_os(char *source, int ac, char **av) +{ + if (ac < 1) + return MOD_CONT; + m_privmsg(source, av[0], av[1]); + return MOD_CONT; +} + +/* EVENT : NS */ +int anope_event_ns(char *source, int ac, char **av) +{ + if (ac < 1) + return MOD_CONT; + m_privmsg(source, av[0], av[1]); + return MOD_CONT; +} + +/* EVENT : MS */ +int anope_event_ms(char *source, int ac, char **av) +{ + if (ac < 1) + return MOD_CONT; + m_privmsg(source, av[0], av[1]); + return MOD_CONT; +} + +/* EVENT : HS */ +int anope_event_hs(char *source, int ac, char **av) +{ + if (ac < 1) + return MOD_CONT; + m_privmsg(source, av[0], av[1]); + return MOD_CONT; +} + +/* EVENT : CS */ +int anope_event_cs(char *source, int ac, char **av) +{ + if (ac < 1) + return MOD_CONT; + m_privmsg(source, av[0], av[1]); + 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* */ +void moduleAddIRCDMsgs(void) { + Message *m; + + m = createMessage("401", NULL); addCoreMessage(IRCD,m); + m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); + m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); + m = createMessage("INVITE", NULL); addCoreMessage(IRCD,m); + m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); + m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); + m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); + m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); + m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("NOTICE", NULL); addCoreMessage(IRCD,m); + m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); + m = createMessage("PASS", NULL); addCoreMessage(IRCD,m); + m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); + m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); + m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); + m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); + m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); + m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); + m = createMessage("USER", NULL); addCoreMessage(IRCD,m); + m = createMessage("WALLOPS", NULL); addCoreMessage(IRCD,m); + m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); + m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m); + m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m); + m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m); + m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m); + m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m); + m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m); + m = createMessage("SVSKILL", NULL); addCoreMessage(IRCD,m); + m = createMessage("SVSMODE", NULL); addCoreMessage(IRCD,m); + m = createMessage("SVSNICK", NULL); addCoreMessage(IRCD,m); + m = createMessage("SVSNOOP", NULL); addCoreMessage(IRCD,m); + m = createMessage("SQLINE", NULL); addCoreMessage(IRCD,m); + m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m); + m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); + m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m); + m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m); + m = createMessage("MS", anope_event_ms); addCoreMessage(IRCD,m); + m = createMessage("NS", anope_event_ns); addCoreMessage(IRCD,m); + m = createMessage("OS", anope_event |
