diff options
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | src/channels.c | 50 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 79 | ||||
-rw-r--r-- | version.log | 6 |
4 files changed, 80 insertions, 58 deletions
@@ -25,6 +25,9 @@ Provided by Jan Milants <jan_renee@msn.com> - 2007 04/21 F Array count decremention in the ChanServ access lists. [#662] 04/21 F Swapped ACCESS_ADD and ACCESS_CHANGE events in cs_xop. [#705] +Provided by Jilles Tjoelker <jilles+anope@stack.nl> - 2007 +04/21 F Various Charybdis and TS6 related fixes. [#707] + Anope Version 1.7.18 -------------------- 12/09 A Ability to see if AutoOp is enabled in NickServ INFO displays. [#621] diff --git a/src/channels.c b/src/channels.c index 3d7f8487f..fd6c2e05a 100644 --- a/src/channels.c +++ b/src/channels.c @@ -218,7 +218,8 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av, } } - if (!(user = finduser(*av))) { + if (!(user = finduser(*av)) + && !(UseTS6 && ircd->ts6 && (user = find_byuid(*av)))) { if (debug) { alog("debug: MODE %s %c%c for nonexistent user %s", chan->name, (add ? '+' : '-'), mode, *av); @@ -1080,7 +1081,7 @@ void do_cmode(const char *source, int ac, char **av) { Channel *chan; ChannelInfo *ci = NULL; - int i, tofree0 = 0, tofree1 = 0, tofree2 = 0; + int i; char *t; if (ircdcap->tsmode) { @@ -1106,37 +1107,10 @@ void do_cmode(const char *source, int ac, char **av) } /* :42XAAAAAO TMODE 1106409026 #ircops +b *!*@*.aol.com */ - if (UseTS6 && ircd->ts6) { - if (*av[0] == '#' || *av[0] == '&') { - if (debug) { - alog("debug: Before TS6 swap: do_cmode() chan %s : mode %s : extra %s", av[1], av[2], av[3]); - } - if (ac >= 2) { - av[0] = sstrdup(av[1]); - tofree0 = 1; - } else { - av[0] = NULL; - } - if (ac >= 3) { - av[1] = sstrdup(av[2]); - tofree1 = 1; - } else { - av[1] = NULL; - } - if (ac >= 4) { - av[2] = sstrdup(av[3]); - tofree2 = 1; - } else { - av[2] = NULL; - } - if (debug) { - alog("debug: After TS swap: do_cmode() chan %s : mode %s : extra %s", av[0], av[1], av[2]); - } - } else { - if (debug) { - alog("debug: TS swap not needed: do_cmode() chan %s : mode %s : extra %s", av[0], av[1], av[2]); - } + if (isdigit(av[0][0])) { + ac--; + av++; } } @@ -1148,12 +1122,6 @@ void do_cmode(const char *source, int ac, char **av) alog("debug: MODE %s for nonexistent channel %s", merge_args(ac - 1, av + 1), av[0]); } - if (tofree0) - free(av[0]); - if (tofree1) - free(av[1]); - if (tofree2) - free(av[2]); return; } @@ -1169,12 +1137,6 @@ void do_cmode(const char *source, int ac, char **av) ac--; av++; chan_set_modes(source, chan, ac, av, 1); - if (tofree0) - free(av[0]); - if (tofree1) - free(av[1]); - if (tofree2) - free(av[2]); } /*************************************************************************/ diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 6d16eeec5..b86955ed3 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -73,12 +73,12 @@ IRCDVar myIrcd[] = { 0, /* Chan Reg */ 0, /* Channel Mode */ 0, /* vidents */ - 0, /* svshold */ + 1, /* svshold */ 0, /* time stamp on mode */ 0, /* NICKIP */ 0, /* UMODE */ 0, /* O:LINE */ - 0, /* VHOST ON NICK */ + 1, /* VHOST ON NICK */ 0, /* Change RealName */ CMODE_p, /* No Knock */ 0, /* Admin Only */ @@ -596,14 +596,14 @@ int anope_event_nick(char *source, int ac, char **av) /* Source is always the server */ *source = '\0'; user = do_nick(source, av[0], av[4], av[5], s->name, av[8], - strtoul(av[2], NULL, 10), 0, 0, "*", av[7]); + strtoul(av[2], NULL, 10), 0, 0, NULL, av[7]); if (user) { anope_set_umode(user, 1, &av[3]); } } else { if (ac != 2) { user = do_nick(source, av[0], av[4], av[5], av[6], av[7], - strtoul(av[2], NULL, 10), 0, 0, "*", NULL); + strtoul(av[2], NULL, 10), 0, 0, NULL, NULL); if (user) anope_set_umode(user, 1, &av[3]); } else { @@ -614,6 +614,41 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } +/* + TS6 + av[0] = nick + av[1] = hop + av[2] = ts + av[3] = modes + av[4] = user + av[5] = vhost + av[6] = IP + av[7] = UID + ac[8] = host or * + ac[9] = services login + av[10] = info + +*/ +int anope_event_euid(char *source, int ac, char **av) +{ + Server *s; + User *user; + time_t ts; + + if (UseTS6 && ac == 11) { + s = findserver_uid(servlist, source); + /* Source is always the server */ + *source = '\0'; + ts = strtoul(av[2], NULL, 10); + user = do_nick(source, av[0], av[4], !strcmp(av[8], "*") ? av[5] : av[8], s->name, av[10], + ts, !stricmp(av[0], av[9]) ? ts : 0, 0, av[5], av[7]); + if (user) { + anope_set_umode(user, 1, &av[3]); + } + } + return MOD_CONT; +} + int anope_event_topic(char *source, int ac, char **av) { User *u; @@ -737,7 +772,6 @@ void moduleAddIRCDMsgs(void) if (UseTS6) { TS6SID = sstrdup(Numeric); - UseTSMODE = 1; /* TMODE */ } m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); @@ -777,6 +811,7 @@ void moduleAddIRCDMsgs(void) m = createMessage("421", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("ENCAP", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m); + m = createMessage("EUID", anope_event_euid); addCoreMessage(IRCD,m); } /* *INDENT-ON* */ @@ -967,11 +1002,12 @@ void charybdis_cmd_svsinfo() PARA - supports invite broadcasting for +p ENCAP - supports message encapsulation SERVICES - supports services-oriented TS6 extensions + EUID - supports EUID and non-ENCAP CHGHOST */ void charybdis_cmd_capab() { send_cmd(NULL, - "CAPAB :QS EX CHW IE KLN GLN KNOCK TB UNKLN CLUSTER ENCAP SERVICES"); + "CAPAB :QS EX CHW IE KLN GLN KNOCK TB UNKLN CLUSTER ENCAP SERVICES EUID"); } /* PASS */ @@ -1069,10 +1105,16 @@ int anope_event_away(char *source, int ac, char **av) int anope_event_kill(char *source, int ac, char **av) { + User *u = NULL; + if (ac != 2) return MOD_CONT; - m_kill(av[0], av[1]); + if (UseTS6) { + u = find_byuid(av[0]); + } + + m_kill(u ? u->nick : av[0], av[1]); return MOD_CONT; } @@ -1092,7 +1134,8 @@ void charybdis_cmd_eob() int anope_event_join(char *source, int ac, char **av) { if (ac != 1) { - do_sjoin(source, ac, av); + /* ignore cmodes in JOIN as per TS6 v8 */ + do_sjoin(source, ac > 2 ? 2 : ac, av); return MOD_CONT; } else { do_join(source, ac, av); @@ -1524,7 +1567,7 @@ int anope_event_mode(char *source, int ac, char **av) int anope_event_tmode(char *source, int ac, char **av) { - if (*av[1] == '#' || *av[1] == '&') { + if (ac > 2 && (*av[1] == '#' || *av[1] == '&')) { do_cmode(source, ac, av); } return MOD_CONT; @@ -1574,19 +1617,29 @@ int anope_event_capab(char *source, int ac, char **av) /* SVSHOLD - set */ void charybdis_cmd_svshold(char *nick) { - /* Not supported by this IRCD */ + send_cmd(NULL, "ENCAP * NICKDELAY 300 %s", nick); } /* SVSHOLD - release */ void charybdis_cmd_release_svshold(char *nick) { - /* Not Supported by this IRCD */ + send_cmd(NULL, "ENCAP * NICKDELAY 0 %s", nick); } /* SVSNICK */ void charybdis_cmd_svsnick(char *nick, char *newnick, time_t when) { - /* RSFNC blah */ + User *u; + + if (!nick || !newnick) { + return; + } + + u = finduser(nick); + if (!u) + return; + send_cmd(NULL, "ENCAP %s RSFNC %s %s %ld %ld", u->server->name, + u->nick, newnick, (long int)when, (long int)u->timestamp); } void charybdis_cmd_guest_nick(char *nick, char *user, char *host, char *real, @@ -1928,7 +1981,7 @@ int AnopeInit(int argc, char **argv) pmodule_ircd_cbmodes(myCbmodes); pmodule_ircd_cmmodes(myCmmodes); pmodule_ircd_csmodes(myCsmodes); - pmodule_ircd_useTSMode(1); + pmodule_ircd_useTSMode(0); /** Deal with modes anope _needs_ to know **/ pmodule_invis_umode(UMODE_i); diff --git a/version.log b/version.log index 49a0f2746..9af07d1b1 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="18" VERSION_EXTRA="-svn" -VERSION_BUILD="1240" +VERSION_BUILD="1241" # $Log$ # +# BUILD : 1.7.18 (1241) +# BUGS : 707 +# NOTES : Applied a patch by jilles to fix various charybdis and ts6 related issues +# # BUILD : 1.7.18 (1240) # BUGS : 706 # NOTES : Fixed EVENT_ACCESS_DEL nog being sent on each delete when mass-deleting in cs_xop |