diff options
| author | dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-06-18 16:38:43 +0000 |
|---|---|---|
| committer | dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-06-18 16:38:43 +0000 |
| commit | 1d1c478e4ff9c484be01ad0d55d5f3c0a91b2561 (patch) | |
| tree | e2d601a6ee6a167671da595b22be602aaaa6c4a1 | |
| parent | bb020753879abb7ede7c0343f528027a2b99ebb2 (diff) | |
BUILD : 1.7.4 (206) BUGS : 55 NOTES : Added proper Bahamut1.8 support. Merged r132:195 from branch branches/proto/anope-bahamut18 which should now be obsolete.
git-svn-id: svn://svn.anope.org/anope/trunk@206 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@148 5417fbe8-f217-4b02-8779-1006273d7864
| -rw-r--r-- | Changes | 1 | ||||
| -rw-r--r-- | Changes.conf | 26 | ||||
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | botserv.c | 21 | ||||
| -rw-r--r-- | channels.c | 31 | ||||
| -rw-r--r-- | chanserv.c | 124 | ||||
| -rw-r--r-- | config.c | 2 | ||||
| -rw-r--r-- | data/example.conf | 17 | ||||
| -rw-r--r-- | docs/README | 5 | ||||
| -rw-r--r-- | extern.h | 27 | ||||
| -rw-r--r-- | init.c | 7 | ||||
| -rw-r--r-- | messages.c | 39 | ||||
| -rw-r--r-- | nickserv.c | 27 | ||||
| -rw-r--r-- | operserv.c | 91 | ||||
| -rw-r--r-- | send.c | 38 | ||||
| -rw-r--r-- | servers.c | 259 | ||||
| -rw-r--r-- | services.h | 31 | ||||
| -rw-r--r-- | users.c | 48 | ||||
| -rw-r--r-- | version.log | 7 | ||||
| -rw-r--r-- | version.sh | 2 |
20 files changed, 625 insertions, 183 deletions
@@ -1,6 +1,7 @@ Anope Version S V N ------------------- Provided by Anope Dev. <dev@anope.org> - 2004 +06/18 A Added proper Bahamut1.8 support. [ #55] Anope Version 1.7.4 ------------------- diff --git a/Changes.conf b/Changes.conf index 1c16c368b..57de5ffc3 100644 --- a/Changes.conf +++ b/Changes.conf @@ -1,7 +1,33 @@ Anope Version S V N ------------------- ** ADDED CONFIGURATION DIRECTIVES ** + +# UseSVSHOLD [OPTIONAL] +# Allows Bahamut-networks to use SVSHOLD instead of the services +# enforcer. This option has been introduced in Bahamut 1.4.35 and +# places a temporary Q:Line instead of introducing a new nick, +# which is better for both CPU and bandwidth. If you enable this +# option on a pre-1.4.35 Bahamut, it is most likely to break. +#UseSVSHOLD + ** MODIFIED CONFIGURATION DIRECTIVES ** + +# NetworkDomain <name> [OPTIONAL] +# +# If your network has a common domain name, specify it there (for +# example, all IRCZONE servers have a name ending in ".irczone.cl", +# so "irczone.cl" would be set there. +# +# You can specify more than one Network Domain by separating each one by +# a space: NetworkDomain "localnet.net localnet.com" +# +# Note that this directive is no longer used by the GLOBAL command, since +# it uses a dynamic list of connected servers regardless of their +# domains. However, some modules may still use this value, so you might +# want to keep it just in case. + +NetworkDomain "localnet.com" + ** DELETED CONFIGURATION DIRECTIVES ** Anope Version 1.7.4 @@ -40,13 +40,13 @@ CFLAGS = $(CDEFS) $(BASE_CFLAGS) $(MORE_CFLAGS) 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 sessions.o slist.o sockutil.o \ + process.o protocol.o proxy.o send.o servers.o sessions.o slist.o sockutil.o \ timeout.o users.o \ $(VSNPRINTF_O) $(RDB_O) $(MYSQL_O) 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 sessions.c slist.c sockutil.c \ + process.c protocol.c proxy.c send.c servers.c sessions.c slist.c sockutil.c \ timeout.c users.c \ $(VSNPRINTF_C) $(RDB_C) $(MYSQL_C) @@ -143,6 +143,7 @@ process.o: process.c services.h messages.h protocol.o: protocol.c services.h proxy.o: proxy.c services.h pseudo.h send.o: send.c services.h +servers.o: servers.c services.h sessions.o: sessions.c services.h pseudo.h slist.o: slist.c services.h slist.h sockutil.o: sockutil.c services.h @@ -952,8 +952,7 @@ void bot_join(ChannelInfo * ci) av[1] = sstrdup("-b"); for (i = 0; i < count; i++) { if (match_wild_nocase(ci->c->bans[i], botmask)) { - send_cmd(ci->bi->nick, "MODE %s -b %s", ci->name, - bans[i]); + send_mode(ci->bi->nick, ci->name, "%s", bans[i]); av[2] = sstrdup(bans[i]); do_cmode(ci->bi->nick, 3, av); free(av[2]); @@ -980,14 +979,14 @@ void bot_join(ChannelInfo * ci) #endif #if defined(IRC_UNREAL) || defined (IRC_VIAGRA) - send_cmd(ci->bi->nick, "MODE %s +ao %s %s", ci->c->name, ci->bi->nick, - ci->bi->nick); + send_mode(ci->bi->nick, ci->c->name, "+ao %s %s", ci->bi->nick, + ci->bi->nick); #elif defined(IRC_PTLINK) /* PTLinks requieres an IRCop to u-line changes, so use ChanServ */ - send_cmd(s_ChanServ, "MODE %s +ao %s %s", ci->c->name, ci->bi->nick, - ci->bi->nick); + send_mode(s_ChanServ, ci->c->name, "+ao %s %s", ci->bi->nick, + ci->bi->nick); #else - send_cmd(ci->bi->nick, "MODE %s +o %s", ci->c->name, ci->bi->nick); + send_mode(ci->bi->nick, ci->c->name, "+o %s", ci->bi->nick); #endif } @@ -1031,7 +1030,7 @@ static void check_ban(ChannelInfo * ci, User * u, int ttbtype) av[1] = sstrdup("+b"); get_idealban(ci, u, mask, sizeof(mask)); av[2] = mask; - send_cmd(ci->bi->nick, "MODE %s +b %s", av[0], av[2]); + send_mode(ci->bi->nick, av[0], "+b %s", av[2]); do_cmode(ci->bi->nick, 3, av); free(av[1]); } @@ -1102,7 +1101,7 @@ static void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, av[1] = sstrdup("+b"); get_idealban(ci, u, mask, sizeof(mask)); av[2] = mask; - send_cmd(ci->bi->nick, "MODE %s +b %s", av[0], av[2]); + send_mode(ci->bi->nick, av[0], "+b %s", av[2]); do_cmode(ci->bi->nick, 3, av); free(av[1]); @@ -1191,7 +1190,7 @@ static void bot_raw_mode(User * requester, ChannelInfo * ci, char *mode, av[1] = mode; av[2] = nick; - send_cmd(ci->bi->nick, "MODE %s %s %s", av[0], av[1], av[2]); + send_mode(ci->bi->nick, av[0], "%s %s", av[1], av[2]); do_cmode(ci->bi->nick, 3, av); } @@ -1227,7 +1226,7 @@ static void bot_raw_unban(ChannelInfo * ci, char *nick) for (i = 0; i < count; i++) { if (match_usermask(bans[i], u)) { - send_cmd(ci->bi->nick, "MODE %s -b %s", ci->name, bans[i]); + send_mode(ci->bi->nick, ci->name, "-b %s", bans[i]); av[2] = bans[i]; do_cmode(ci->bi->nick, 3, av); } diff --git a/channels.c b/channels.c index 61d4c33d1..9e51ba9e6 100644 --- a/channels.c +++ b/channels.c @@ -593,8 +593,8 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av, BotInfo *bi; if ((bi = findbot(*av))) { - send_cmd(bi->nick, "MODE %s +%c %s", chan->name, mode, - bi->nick); + send_mode(bi->nick, chan->name, "+%c %s", mode, + bi->nick); continue; } } @@ -1114,6 +1114,29 @@ void do_cmode(const char *source, int ac, char **av) { Channel *chan; ChannelInfo *ci = NULL; +#ifdef IRC_BAHAMUT + int i; + char *t; + + /* TSMODE for bahamut - leave this code out to break MODEs. -GD */ + if (uplink_capab & CAPAB_TSMODE) { + for (i = 0; i < strlen(av[1]); i++) { + if (!isdigit(av[1][i])) + break; + } + if (av[1][i] == '\0') { + /* We have a valid TS field in av[1] now, so we can strip it off */ + /* After we swap av[0] and av[1] ofcourse to not break stuff! :) */ + t = av[0]; + av[0] = av[1]; + av[1] = t; + ac--; + av++; + } else { + alog("TSMODE enabled but MODE has no valid TS"); + } + } +#endif chan = findchan(av[0]); if (!chan) { @@ -1183,7 +1206,7 @@ static void add_ban(Channel * chan, char *mask) snprintf(botmask, sizeof(botmask), "%s!%s@%s", bi->nick, bi->user, bi->host); if (match_wild_nocase(mask, botmask)) { - send_cmd(bi->nick, "MODE %s -b %s", chan->name, mask); + send_mode(bi->nick, chan->name, "-b %s", mask); return; } } @@ -1597,7 +1620,7 @@ void do_mass_mode(char *modes) if (c->bouncy_modes) { return; } else { - send_cmd(s_OperServ, "MODE %s %s", c->name, modes); + send_mode(s_OperServ, c->name, "%s", modes); chan_set_modes(s_OperServ, c, ac, av, 1); } } diff --git a/chanserv.c b/chanserv.c index 19e7d6b71..06236c547 100644 --- a/chanserv.c +++ b/chanserv.c @@ -1351,7 +1351,7 @@ void check_modes(Channel * c) #ifndef IRC_HYBRID if (c->mode & CMODE_r) { c->mode &= ~CMODE_r; - send_cmd(whosends(ci), "MODE %s -r", c->name); + send_mode(whosends(ci), c->name, "-r"); } #endif return; @@ -1440,8 +1440,8 @@ void check_modes(Channel * c) *end = 0; *end2 = 0; - send_cmd(whosends(ci), "MODE %s %s%s", c->name, modebuf, - (end2 == argbuf ? "" : argbuf)); + send_mode(whosends(ci), c->name, "%s%s", modebuf, + (end2 == argbuf ? "" : argbuf)); } /*************************************************************************/ @@ -1459,14 +1459,12 @@ int check_valid_admin(User * user, Channel * chan, int servermode) if (servermode && !check_access(user, chan->ci, CA_AUTOPROTECT)) { notice_lang(s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); - send_cmd(whosends(chan->ci), "MODE %s -a %s", chan->name, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-a %s", user->nick); return 0; } if (check_access(user, chan->ci, CA_AUTODEOP)) { - send_cmd(whosends(chan->ci), "MODE %s -a %s", chan->name, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-a %s", user->nick); return 0; } @@ -1494,33 +1492,30 @@ int check_valid_op(User * user, Channel * chan, int servermode) #ifdef HAS_HALFOP # if defined(IRC_UNREAL) if (check_access(user, chan->ci, CA_AUTOHALFOP)) { - send_cmd(whosends(chan->ci), "MODE %s -aoq %s %s %s", - chan->name, user->nick, user->nick, user->nick); + send_mode(whosends(chan->ci), chan->name, "-aoq %s %s %s", + user->nick, user->nick, user->nick); } else { - send_cmd(whosends(chan->ci), "MODE %s -ahoq %s %s %s %s", - chan->name, user->nick, user->nick, user->nick, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-ahoq %s %s %s %s", + user->nick, user->nick, user->nick, user->nick); } # elif defined(IRC_ULTIMATE3) || defined(IRC_RAGE2) if (check_access(user, chan->ci, CA_AUTOHALFOP)) { - send_cmd(whosends(chan->ci), "MODE %s -ao %s %s", - chan->name, user->nick, user->nick); + send_mode(whosends(chan->ci), chan->name, "-ao %s %s", + user->nick, user->nick); } else { - send_cmd(whosends(chan->ci), "MODE %s -aoh %s %s %s", - chan->name, user->nick, user->nick, user->nick); + send_mode(whosends(chan->ci), chan->name, "-aoh %s %s %s", + user->nick, user->nick, user->nick); } # else if (check_access(user, chan->ci, CA_AUTOHALFOP)) { - send_cmd(whosends(chan->ci), "MODE %s -o %s", chan->name, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-o %s", user->nick); } else { - send_cmd(whosends(chan->ci), "MODE %s -ho %s %s", chan->name, - user->nick, user->nick); + send_mode(whosends(chan->ci), chan->name, "-ho %s %s", + user->nick, user->nick); } # endif #else - send_cmd(whosends(chan->ci), "MODE %s -o %s", chan->name, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-o %s", user->nick); #endif return 0; } @@ -1528,16 +1523,14 @@ int check_valid_op(User * user, Channel * chan, int servermode) if (check_access(user, chan->ci, CA_AUTODEOP)) { #ifdef HAS_HALFOP # ifdef IRC_UNREAL - send_cmd(whosends(chan->ci), "MODE %s -ahoq %s %s %s %s", - chan->name, user->nick, user->nick, user->nick, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-ahoq %s %s %s %s", + user->nick, user->nick, user->nick, user->nick); # else - send_cmd(whosends(chan->ci), "MODE %s -ho %s %s", chan->name, - user->nick, user->nick); + send_mode(whosends(chan->ci), chan->name, "-ho %s %s", user->nick, + user->nick); # endif #else - send_cmd(whosends(chan->ci), "MODE %s -o %s", chan->name, - user->nick); + send_mode(whosends(chan->ci), chan->name, "-o %s", user->nick); #endif return 0; } @@ -1562,7 +1555,7 @@ int check_should_op(User * user, const char *chan) return 0; if (check_access(user, ci, CA_AUTOOP)) { - send_cmd(whosends(ci), "MODE %s +o %s", chan, user->nick); + send_mode(whosends(ci), chan, "+o %s", user->nick); return 1; } @@ -1585,7 +1578,7 @@ int check_should_voice(User * user, const char *chan) return 0; if (check_access(user, ci, CA_AUTOVOICE)) { - send_cmd(whosends(ci), "MODE %s +v %s", chan, user->nick); + send_mode(whosends(ci), chan, "+v %s", user->nick); return 1; } @@ -1604,7 +1597,7 @@ int check_should_halfop(User * user, const char *chan) return 0; if (check_access(user, ci, CA_AUTOHALFOP)) { - send_cmd(whosends(ci), "MODE %s +h %s", chan, user->nick); + send_mode(whosends(ci), chan, "+h %s", user->nick); return 1; } @@ -1626,8 +1619,7 @@ int check_should_owner(User * user, const char *chan) if (((ci->flags & CI_SECUREFOUNDER) && is_real_founder(user, ci)) || (!(ci->flags & CI_SECUREFOUNDER) && is_founder(user, ci))) { - send_cmd(whosends(ci), "MODE %s +oq %s %s", chan, user->nick, - user->nick); + send_mode(whosends(ci), chan, "+oq %s %s", user->nick, user->nick); return 1; } @@ -1648,8 +1640,7 @@ int check_should_protect(User * user, const char *chan) return 0; if (check_access(user, ci, CA_AUTOPROTECT)) { - send_cmd(whosends(ci), "MODE %s +oa %s %s", chan, user->nick, - user->nick); + send_mode(whosends(ci), chan, "+oa %s %s", user->nick, user->nick); return 1; } @@ -1796,7 +1787,7 @@ int check_kick(User * user, char *chan) free(av[1]); } - send_cmd(whosends(ci), "MODE %s +b %s %lu", chan, mask, time(NULL)); + send_mode(whosends(ci), chan, "+b %s %lu", mask, time(NULL)); send_cmd(whosends(ci), "KICK %s %s :%s", chan, user->nick, reason); return 1; @@ -1850,7 +1841,7 @@ void restore_topic(const char *chan) #ifdef IRC_HYBRID if (whosends(ci) == s_ChanServ) { send_cmd(NULL, "SJOIN %ld %s + :%s", time(NULL), chan, s_ChanServ); - send_cmd(NULL, "MODE %s +o %s", chan, s_ChanServ); + send_mode(NULL, chan, "+o %s", s_ChanServ); } send_cmd(whosends(ci), "TOPIC %s :%s", chan, c->topic ? c->topic : ""); if (whosends(ci) == s_ChanServ) { @@ -1893,7 +1884,7 @@ int check_topiclock(Channel * c, time_t topic_time) if (whosends(ci) == s_ChanServ) { send_cmd(NULL, "SJOIN %ld %s + :%s", time(NULL), c->name, s_ChanServ); - send_cmd(NULL, "MODE %s +o %s", c->name, s_ChanServ); + send_mode(NULL, c->name, "+o %s", s_ChanServ); } send_cmd(whosends(ci), "TOPIC %s :%s", c->name, c->topic ? c->topic : ""); @@ -1973,7 +1964,7 @@ void cs_remove_nick(const NickCore * nc) /* Maybe move this to delchan() ? */ if ((ci->c) && (ci->c->mode & CMODE_r)) { ci->c->mode &= ~CMODE_r; - send_cmd(whosends(ci), "MODE %s -r", ci->name); + send_mode(whosends(ci), ci->name, "-r"); } #endif @@ -2729,7 +2720,7 @@ static int do_register(User * u) /* Implement new mode lock */ check_modes(c); #if defined(IRC_ULTIMATE3) || defined(IRC_RAGE2) - send_cmd(s_ChanServ, "MODE %s +a %s", chan, u->nick); + send_mode(s_ChanServ, chan, "+a %s", u->nick); #endif } return MOD_CONT; @@ -2856,7 +2847,7 @@ static int do_drop(User * u) #ifndef IRC_HYBRID if (ci->c) { ci->c->mode &= ~CMODE_r; - send_cmd(whosends(ci), "MODE %s -r", ci->name); + send_mode(whosends(ci), ci->name, "-r"); } #endif alog("%s: Channel %s dropped by %s!%s@%s (founder: %s)", @@ -4228,7 +4219,7 @@ void stick_mask(ChannelInfo * ci, AutoKick * akick) av[0] = sstrdup("+b"); av[1] = akick->u.mask; - send_cmd(whosends(ci), "MODE %s +b %s", ci->c->name, akick->u.mask); + send_mode(whosends(ci), ci->c->name, "+b %s", akick->u.mask); chan_set_modes(s_ChanServ, ci->c, 2, av, 1); free(av[0]); } @@ -4248,8 +4239,7 @@ void stick_all(ChannelInfo * ci) av[0] = sstrdup("+b"); av[1] = akick->u.mask; - send_cmd(whosends(ci), "MODE %s +b %s", ci->c->name, - akick->u.mask); + send_mode(whosends(ci), ci->c->name, "+b %s", akick->u.mask); chan_set_modes(s_ChanServ, ci->c, 2, av, 1); free(av[0]); } @@ -5195,8 +5185,8 @@ static int do_util(User * u, CSModeUtil * util) for (uc = u->chans; uc; uc = uc->next) { if ((ci = uc->chan->ci) && !(ci->flags & CI_VERBOTEN) && check_access(u, ci, util->levelself)) { - send_cmd(whosends(ci), "MODE %s %s %s", uc->chan->name, - util->mode, u->nick); + send_mode(whosends(ci), uc->chan->name, "%s %s", + util->mode, u->nick); chan_set_modes(s_ChanServ, uc->chan, 2, av, 1); if (util->notice && ci->flags & util->notice) @@ -5234,8 +5224,7 @@ static int do_util(User * u, CSModeUtil * util) notice_lang(s_ChanServ, u, PERMISSION_DENIED); #endif } else { - send_cmd(whosends(ci), "MODE %s %s %s", c->name, util->mode, - u2->nick); + send_mode(whosends(ci), c->name, "%s %s", util->mode, u2->nick); av[0] = util->mode; av[1] = u2->nick; @@ -5335,8 +5324,8 @@ static int do_owner(User * u) for (uc = u->chans; uc; uc = uc->next) { if ((ci = uc->chan->ci) && !(ci->flags & CI_VERBOTEN) && is_founder(u, ci)) { - send_cmd(whosends(ci), "MODE %s %s %s", uc->chan->name, - av[0], u->nick); + send_mode(whosends(ci), uc->chan->name, "%s %s", + av[0], u->nick); chan_set_modes(s_ChanServ, uc->chan, 2, av, 1); } } @@ -5356,7 +5345,7 @@ static int do_owner(User * u) } else if (!is_founder(u, ci)) { notice_lang(s_ChanServ, u, ACCESS_DENIED); } else { - send_cmd(whosends(ci), "MODE %s +q %s", c->name, u->nick); + send_mode(whosends(ci), c->name, "+q %s", u->nick); av[0] = sstrdup("+q"); av[1] = u->nick; @@ -5387,8 +5376,8 @@ static int do_deowner(User * u) for (uc = u->chans; uc; uc = uc->next) { if ((ci = uc->chan->ci) && !(ci->flags & CI_VERBOTEN) && is_founder(u, ci)) { - send_cmd(whosends(ci), "MODE %s %s %s", uc->chan->name, - av[0], u->nick); + send_mode(whosends(ci), uc->chan->name, "%s %s", + av[0], u->nick); chan_set_modes(s_ChanServ, uc->chan, 2, av, 1); } } @@ -5408,7 +5397,7 @@ static int do_deowner(User * u) } else if (!is_founder(u, ci)) { notice_lang(s_ChanServ, u, ACCESS_DENIED); } else { - send_cmd(whosends(ci), "MODE %s -q %s", c->name, u->nick); + send_mode(whosends(ci), c->name, "-q %s", u->nick); av[0] = sstrdup("-q"); av[1] = u->nick; @@ -5559,8 +5548,7 @@ static int do_ban(User * u) av[0] = sstrdup("+b"); get_idealban(ci, u, mask, sizeof(mask)); av[1] = mask; - send_cmd(whosends(ci), "MODE %s +b %s", uc->chan->name, - av[1]); + send_mode(whosends(ci), uc->chan->name, "+b %s", av[1]); chan_set_modes(s_ChanServ, uc->chan, 2, av, 1); free(av[0]); @@ -5615,7 +5603,7 @@ static int do_ban(User * u) av[0] = sstrdup("+b"); get_idealban(ci, u2, mask, sizeof(mask)); av[1] = mask; - send_cmd(whosends(ci), "MODE %s +b %s", c->name, av[1]); + send_mode(whosends(ci), c->name, "+b %s", av[1]); chan_set_modes(s_ChanServ, c, 2, av, 1); free(av[0]); @@ -5683,7 +5671,7 @@ static int do_cs_topic(User * u) if (whosends(ci) == s_ChanServ) { send_cmd(NULL, "SJOIN %ld %s + :%s", time(NULL), c->name, s_ChanServ); - send_cmd(NULL, "MODE %s +o %s", c->name, s_ChanServ); + send_mode(NULL, c->name, "+o %s", s_ChanServ); } send_cmd(whosends(ci), "TOPIC %s :%s", c->name, c->topic ? c->topic : ""); @@ -5729,7 +5717,7 @@ static int do_unban(User * u) av[1] = sstrdup("-b"); for (i = 0; i < count; i++) { if (match_usermask(bans[i], u)) { - send_cmd(whosends(ci), "MODE %s -b %s", chan, bans[i]); + send_mode(whosends(ci), chan, "-b %s", bans[i]); av[2] = sstrdup(bans[i]); do_cmode(s_ChanServ, 3, av); free(av[2]); @@ -5778,7 +5766,7 @@ static int do_clear(User * u) av[0] = sstrdup(chan); av[1] = sstrdup("-b"); av[2] = bans[i]; - send_cmd(whosends(ci), "MODE %s %s :%s", av[0], av[1], av[2]); + send_mode(whosends(ci), av[0], "%s :%s", av[1], av[2]); do_cmode(s_ChanServ, 3, av); free(av[2]); free(av[1]); @@ -5801,7 +5789,7 @@ static int do_clear(User * u) av[0] = sstrdup(chan); av[1] = sstrdup("-e"); av[2] = excepts[i]; - send_cmd(whosends(ci), "MODE %s %s :%s", av[0], av[1], av[2]); + send_mode(whosends(ci), av[0], "%s :%s", av[1], av[2]); do_cmode(s_ChanServ, 3, av); free(av[2]); free(av[1]); @@ -5816,8 +5804,8 @@ static int do_clear(User * u) if (c->mode) { /* Clear modes */ - send_cmd(s_ChanServ, "MODE %s %s %s", c->name, MODESTOREMOVE, - c->key ? c->key : ""); + send_mode(s_ChanServ, c->name, "%s %s", MODESTOREMOVE, + c->key ? c->key : ""); argv[0] = sstrdup(MODESTOREMOVE); argv[1] = c->key ? c->key : NULL; chan_set_modes(s_OperServ, c, c->key ? 2 : 1, argv, 0); @@ -5857,7 +5845,7 @@ static int do_clear(User * u) *end = 0; - send_cmd(whosends(ci), "MODE %s -%s", c->name, buf); + send_mode(whosends(ci), c->name, "-%s", buf); c->mode = 0; check_modes(c); } @@ -5873,7 +5861,7 @@ static int do_clear(User * u) av[0] = sstrdup(chan); av[1] = sstrdup("-o"); av[2] = sstrdup(cu->user->nick); - send_cmd(whosends(ci), "MODE %s %s :%s", av[0], av[1], av[2]); + send_mode(whosends(ci), av[0], "%s :%s", av[1], av[2]); do_cmode(s_ChanServ, 3, av); free(av[2]); free(av[1]); @@ -5892,7 +5880,7 @@ static int do_clear(User * u) av[0] = sstrdup(chan); av[1] = sstrdup("-h"); av[2] = sstrdup(cu->user->nick); - send_cmd(whosends(ci), "MODE %s %s :%s", av[0], av[1], av[2]); + send_mode(whosends(ci), av[0], "%s :%s", av[1], av[2]); do_cmode(s_ChanServ, 3, av); free(av[2]); free(av[1]); @@ -5911,7 +5899,7 @@ static int do_clear(User * u) av[0] = sstrdup(chan); av[1] = sstrdup("-v"); av[2] = sstrdup(cu->user->nick); - send_cmd(whosends(ci), "MODE %s %s :%s", av[0], av[1], av[2]); + send_mode(whosends(ci), av[0], "%s :%s", av[1], av[2]); do_cmode(s_ChanServ, 3, av); free(av[2]); free(av[1]); @@ -116,6 +116,7 @@ int UsePrivmsg; int DumpCore; int LogUsers; int NickRegDelay; +int UseSVSHOLD; int UseMail; char *SendMailPath; @@ -611,6 +612,7 @@ Directive directives[] = { {"UpdateTimeout", {{PARAM_TIME, PARAM_RELOAD, &UpdateTimeout}}}, {"UseMail", {{PARAM_SET, PARAM_RELOAD, &UseMail}}}, {"UsePrivmsg", {{PARAM_SET, PARAM_RELOAD, &UsePrivmsg}}}, + {"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}}, {"WallAkillExpire", {{PARAM_SET, PARAM_RELOAD, &WallAkillExpire}}}, {"WallBadOS", {{PARAM_SET, PARAM_RELOAD, &WallBadOS}}}, {"WallDrop", {{PARAM_SET, PARAM_RELOAD, &WallDrop}}}, diff --git a/data/example.conf b/data/example.conf index 201bf5274..8fadac2e0 100644 --- a/data/example.conf +++ b/data/example.conf @@ -235,12 +235,15 @@ HelpChannel "#help" # # If your network has a common domain name, specify it there (for # example, all IRCZONE servers have a name ending in ".irczone.cl", -# so "irczone.cl" would be set there. It will be used by the OperServ -# GLOBAL command, and if you don't have a common domain name, this -# command may just not work. +# so "irczone.cl" would be set there. # # You can specify more than one Network Domain by separating each one by # a space: NetworkDomain "localnet.net localnet.com" +# +# Note that this directive is no longer used by the GLOBAL command, since +# it uses a dynamic list of connected servers regardless of their +# domains. However, some modules may still use this value, so you might +# want to keep it just in case. NetworkDomain "localnet.com" @@ -437,6 +440,14 @@ GlobalOnCycleUP "Services are now back online - have a nice day" # connected for at least X seconds. #NickRegDelay 30 +# UseSVSHOLD [OPTIONAL] +# Allows Bahamut-networks to use SVSHOLD instead of the services +# enforcer. This option has been introduced in Bahamut 1.4.35 and +# places a temporary Q:Line instead of introducing a new nick, +# which is better for both CPU and bandwidth. If you enable this +# option on a pre-1.4.35 Bahamut, it is most likely to break. +#UseSVSHOLD + ########################################################################### # # Mail-related options diff --git a/docs/README b/docs/README index 22c1db10c..c1aab6e3f 100644 --- a/docs/README +++ b/docs/README @@ -61,11 +61,12 @@ Anope credits: JH <jh@irc-chat.net> Joris Vink <joris@anope.org> Lucas Nussbaum <lucas@lucas-nussbaum.net> + Pieter Bootsma <geniusdex@anope.org> Thomas Juberg Stensås <ShadowMaster@Shadow-Realm.org> Trystan .S Lee <trystan@anope.org> openglx <openglx@brasnerd.com.br> Anope Translations: - GeniousDex (nl.l) + GeniusDex (nl.l) Oleg Nikolaev aka Isot <isot@complife.ru> (ru.l) Stuff <the.stuff@gmx.de> (de.l) DrStein (es.l) @@ -123,7 +124,7 @@ Currently available services are: Anope currently works with: - DreamForge 4.6.7 - - Bahamut 1.4.27 or later + - Bahamut 1.4.35 or later - UnrealIRCd 3.1.1 or later (including 3.2) - UltimateIRCd 2.8.2 or later (including 3.0.0) - ViagraIRCd 1.3 or later @@ -279,6 +279,7 @@ E int UsePrivmsg; E int DumpCore; E int LogUsers; E int NickRegDelay; +E int UseSVSHOLD; E char **HostSetters; E int HostNumber; @@ -773,6 +774,8 @@ E void wallops(const char *source, const char *fmt, ...) E void notice(const char *source, const char *dest, const char *fmt, ...) FORMAT(printf,3,4); +E void notice_server(const char *source, Server * s, const char *fmt, ...) + FORMAT(printf,3,4); E void notice_user(const char *source, User *u, const char *fmt, ...) FORMAT(printf,3,4); @@ -783,6 +786,28 @@ E void notice_help(const char *source, User *dest, int message, ...); E void privmsg(const char *source, const char *dest, const char *fmt, ...) FORMAT(printf,3,4); +E void send_mode(const char *source, const char *on, const char *fmt, ...) + FORMAT(printf,3,4); + +/**** servers.c ****/ + +E Server *servlist; +E Server *me_server; +#ifdef IRC_BAHAMUT +E uint16 uplink_capab; +#endif + +E Server *first_server(int flags); +E Server *next_server(int flags); + +E Server *new_server(Server *uplink, const char *name, const char *desc, + uint16 flags); + +E Server *findserver(Server *s, const char *name); + +E void do_server(const char *source, int ac, char **av); +E void do_squit(const char *source, int ac, char **av); + /**** sessions.c ****/ E Exception *exceptions; @@ -825,6 +850,8 @@ E time_t maxusertime; E void set_umode(User * user, int ac, char **av); +E void delete_user(User *user); + E void get_user_stats(long *nusers, long *memuse); E User *finduser(const char *nick); E User *firstuser(void); @@ -63,7 +63,7 @@ extern void moduleAddMsgs(void); do { \ send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", (nick), time(NULL), \ ServiceUser, ServiceHost, ServerName, (name)); \ - if (strcmp(modes, "+")) send_cmd((nick), "MODE %s %s", (nick), (modes)); \ + if (strcmp(modes, "+")) send_mode((nick), (nick), "%s", (modes)); \ send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \ } while (0) #elif defined(IRC_PTLINK) @@ -705,6 +705,9 @@ int init(int ac, char **av) alog("Info: Not reflecting database records."); } #endif + /* Make myself known to myself in the serverlist */ + me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME); + /* Connect to the remote server */ servsock = conn(RemoteServer, RemotePort, LocalHost, LocalPort); if (servsock < 0 && RemoteServer2) { @@ -762,7 +765,7 @@ int init(int ac, char **av) send_cmd(NULL, "PASS %s :TS", RemotePassword2); else if (servernum == 3) send_cmd(NULL, "PASS %s :TS", RemotePassword3); - send_cmd(NULL, "CAPAB NICKIP SSJOIN TS3"); + send_cmd(NULL, "CAPAB NICKIP SSJOIN TS3 NOQUIT TSMODE UNCONNECT"); #elif defined(IRC_HYBRID) if (servernum == 1) send_cmd(NULL, "PASS %s :TS", RemotePassword); diff --git a/messages.c b/messages.c index 571bf6286..12804e036 100644 --- a/messages.c +++ b/messages.c @@ -58,6 +58,28 @@ static int m_away(char *source, int ac, char **av) #ifdef IRC_BAHAMUT +static int m_capab(char *source, int ac, char **av) +{ + int i; + + for (i = 0; i < ac; i++) { + if (!stricmp(av[i], "NOQUIT")) + |
