diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/actions.c | 2 | ||||
| -rw-r--r-- | src/botserv.c | 6 | ||||
| -rw-r--r-- | src/chanserv.c | 4 | ||||
| -rw-r--r-- | src/core/bs_bot.c | 4 | ||||
| -rw-r--r-- | src/core/cs_forbid.c | 2 | ||||
| -rw-r--r-- | src/core/cs_register.c | 2 | ||||
| -rw-r--r-- | src/core/ns_forbid.c | 2 | ||||
| -rw-r--r-- | src/core/ns_register.c | 12 | ||||
| -rw-r--r-- | src/core/os_jupe.c | 6 | ||||
| -rw-r--r-- | src/helpserv.c | 8 | ||||
| -rw-r--r-- | src/hostserv.c | 2 | ||||
| -rw-r--r-- | src/init.c | 2 | ||||
| -rw-r--r-- | src/ircd.c | 74 | ||||
| -rw-r--r-- | src/memoserv.c | 6 | ||||
| -rw-r--r-- | src/messages.c | 70 | ||||
| -rw-r--r-- | src/modules/cs_appendtopic.c | 2 | ||||
| -rw-r--r-- | src/nickserv.c | 2 | ||||
| -rw-r--r-- | src/operserv.c | 2 | ||||
| -rw-r--r-- | src/protocol/bahamut.c | 22 | ||||
| -rw-r--r-- | src/protocol/bahamut.h | 8 | ||||
| -rw-r--r-- | src/protocol/charybdis.c | 53 | ||||
| -rw-r--r-- | src/protocol/charybdis.h | 16 | ||||
| -rw-r--r-- | src/protocol/inspircd11.c | 22 | ||||
| -rwxr-xr-x | src/protocol/inspircd11.h | 10 | ||||
| -rw-r--r-- | src/protocol/ratbox.c | 44 | ||||
| -rw-r--r-- | src/protocol/ratbox.h | 16 | ||||
| -rw-r--r-- | src/protocol/unreal32.c | 28 | ||||
| -rw-r--r-- | src/protocol/unreal32.h | 10 | ||||
| -rw-r--r-- | src/users.c | 10 |
29 files changed, 184 insertions, 263 deletions
diff --git a/src/actions.c b/src/actions.c index 36ce888cc..2a4a9a1de 100644 --- a/src/actions.c +++ b/src/actions.c @@ -219,7 +219,7 @@ void common_svsmode(User * u, const char *modes, const char *arg) } ircdproto->SendSVSMode(u, ac, av); - anope_ProcessUsermodes(u, ac, av); + ircdproto->ProcessUsermodes(u, ac, av); } /*************************************************************************/ diff --git a/src/botserv.c b/src/botserv.c index f19c1fdff..7ff55c9c1 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -92,7 +92,7 @@ void botserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_BotServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_BotServ), u->nick, "PING %s", s); } else { mod_run_cmd(s_BotServ, u, BOTSERV, cmd); } @@ -115,7 +115,7 @@ void botmsgs(User * u, BotInfo * bi, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(bi->nick, u->nick, "PING %s", s); + ircdproto->SendCTCP(bi, u->nick, "PING %s", s); } } @@ -139,7 +139,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* Answer to ping if needed, without breaking the buffer. */ if (!strnicmp(buf, "\1PING", 5)) { - anope_SendCTCP(ci->bi->nick, u->nick, "PING %s", buf); + ircdproto->SendCTCP(ci->bi, u->nick, "PING %s", buf); } /* If it's a /me, cut the CTCP part at the beginning (not diff --git a/src/chanserv.c b/src/chanserv.c index 232a24eb3..a878d0882 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -276,7 +276,7 @@ void chanserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_ChanServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_ChanServ), u->nick, "PING %s", s); } else { mod_run_cmd(s_ChanServ, u, CHANSERV, cmd); } @@ -2160,7 +2160,7 @@ void cs_set_flood(ChannelInfo * ci, const char *value) free(ci->mlock_flood); /* This looks ugly, but it works ;) */ - if (anope_IsFloodModeParamValid(value)) { + if (ircdproto->IsFloodModeParamValid(value)) { ci->mlock_flood = sstrdup(value); } else { ci->mlock_on &= ~ircd->chan_fmode; diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index 035dbcfff..d56f93539 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -111,7 +111,7 @@ int do_bot(User * u) } /* check for hardcored ircd forbidden nicks */ - if (!anope_IsNickValid(nick)) { + if (!ircdproto->IsNickValid(nick)) { notice_lang(s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } @@ -229,7 +229,7 @@ int do_bot(User * u) } /* check for hardcored ircd forbidden nicks */ - if (!anope_IsNickValid(nick)) { + if (!ircdproto->IsNickValid(nick)) { notice_lang(s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index 3085c80bf..5bee0ade4 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -84,7 +84,7 @@ int do_forbid(User * u) if (*chan != '#') { notice_lang(s_ChanServ, u, CHAN_SYMBOL_REQUIRED); return MOD_CONT; - } else if (!anope_IsChannelValid(chan)) { + } else if (!ircdproto->IsChannelValid(chan)) { notice_lang(s_ChanServ, u, CHAN_X_INVALID, chan); return MOD_CONT; } diff --git a/src/core/cs_register.c b/src/core/cs_register.c index efd601c98..c553a63a4 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -95,7 +95,7 @@ int do_register(User * u) notice_lang(s_ChanServ, u, CHAN_REGISTER_NOT_LOCAL); } else if (*chan != '#') { notice_lang(s_ChanServ, u, CHAN_SYMBOL_REQUIRED); - } else if (!anope_IsChannelValid(chan)) { + } else if (!ircdproto->IsChannelValid(chan)) { notice_lang(s_ChanServ, u, CHAN_X_INVALID, chan); } else if (!u->na || !(nc = u->na->nc)) { notice_lang(s_ChanServ, u, CHAN_MUST_REGISTER_NICK, s_NickServ); diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c index 336b44c53..e244c2dc5 100644 --- a/src/core/ns_forbid.c +++ b/src/core/ns_forbid.c @@ -85,7 +85,7 @@ int do_forbid(User * u) if (readonly) notice_lang(s_NickServ, u, READ_ONLY_MODE); - if (!anope_IsNickValid(nick)) { + if (!ircdproto->IsNickValid(nick)) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick); return MOD_CONT; } diff --git a/src/core/ns_register.c b/src/core/ns_register.c index 8908a1917..1b84a67a7 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -6,8 +6,8 @@ * Please read COPYING and README for further details. * * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * + * Based on the original code of Services by Andy Church. + * * $Id$ * */ @@ -133,7 +133,7 @@ int do_register(User * u) return MOD_CONT; } - if (!anope_IsNickValid(u->nick)) { + if (!ircdproto->IsNickValid(u->nick)) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, u->nick); return MOD_CONT; } @@ -357,15 +357,15 @@ int do_confirm(User * u) notice_lang(s_NickServ, u, NICK_REGISTERED_NO_MASK, u->nick); send_event(EVENT_NICK_REGISTERED, 1, u->nick); - - if(enc_decrypt(na->nc->pass, tmp_pass, PASSMAX - 1)==1) + + if(enc_decrypt(na->nc->pass, tmp_pass, PASSMAX - 1)==1) notice_lang(s_NickServ, u, NICK_PASSWORD_IS, tmp_pass); u->lastnickreg = time(NULL); if (ircd->modeonreg) { len = strlen(ircd->modeonreg); strncpy(modes,ircd->modeonreg,512); - if(ircd->rootmodeonid && is_services_root(u)) { + if(ircd->rootmodeonid && is_services_root(u)) { strncat(modes,ircd->rootmodeonid,512-len); } else if(ircd->adminmodeonid && is_services_admin(u)) { strncat(modes,ircd->adminmodeonid,512-len); diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c index 5cab65795..ea5d0a98a 100644 --- a/src/core/os_jupe.c +++ b/src/core/os_jupe.c @@ -77,7 +77,11 @@ int do_jupe(User * u) if (!isValidHost(jserver, 3)) { notice_lang(s_OperServ, u, OPER_JUPE_HOST_ERROR); } else { - anope_SendJupe(jserver, u->nick, reason); + char rbuf[256]; + snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", u->nick, reason ? ": " : "", reason ? reason : ""); + if (findserver(servlist, jserver)) ircdproto->SendSquit(jserver, rbuf); + ircdproto->SendServer(jserver, 2, rbuf); + new_server(me_server, jserver, rbuf, SERVER_JUPED, NULL); if (WallOSJupe) ircdproto->SendGlobops(s_OperServ, "\2%s\2 used JUPE on \2%s\2", diff --git a/src/helpserv.c b/src/helpserv.c index 5a971f48c..b3ca08929 100644 --- a/src/helpserv.c +++ b/src/helpserv.c @@ -6,9 +6,9 @@ * Please read COPYING and README for further details. * * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * $Id$ + * Based on the original code of Services by Andy Church. + * + * $Id$ * */ @@ -60,7 +60,7 @@ void helpserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_HelpServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_HelpServ), u->nick, "PING %s", s); } else { mod_run_cmd(s_HelpServ, u, HELPSERV, cmd); } diff --git a/src/hostserv.c b/src/hostserv.c index d1cf68a21..be2e52e00 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -69,7 +69,7 @@ void hostserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_HostServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_HostServ), u->nick, "PING %s", s); } else { if (ircd->vhost) { mod_run_cmd(s_HostServ, u, HOSTSERV, cmd); diff --git a/src/init.c b/src/init.c index a6a91617c..3e59d4d81 100644 --- a/src/init.c +++ b/src/init.c @@ -739,7 +739,7 @@ int init_secondary(int ac, char **av) ircdproto->SendJoin(findbot(s_GlobalNoticer), LogChannel, time(NULL)); } - anope_SendEOB(); + ircdproto->SendEOB(); /** * Load our delayed modeles - modules that are planing on making clients need to wait till now diff --git a/src/ircd.c b/src/ircd.c index d7de214b1..d9b729ef0 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -38,80 +38,6 @@ void pmodule_ircd_proto(IRCDProto *proto) ircdproto = proto; } -void anope_ProcessUsermodes(User *user, int ac, const char **av) -{ - ircdproto->ProcessUsermodes(user, ac, av); -} - -void anope_SendUnregisteredNick(User *u) -{ - ircdproto->SendUnregisteredNick(u); -} - -void anope_SendSVID2(User *u, const char *ts) -{ - ircdproto->SendSVID2(u, ts); -} - -void anope_SendSVID3(User *u, const char *ts) -{ - ircdproto->SendSVID3(u, ts); -} - -void anope_SendSVSJoin(const char *source, const char *nick, const char *chan, const char *param) -{ - ircdproto->SendSVSJoin(source, nick, chan, param); -} - -void anope_SendSVSPart(const char *source, const char *nick, const char *chan) -{ - ircdproto->SendSVSPart(source, nick, chan); -} - -void anope_SendSWhois(const char *source, const char *who, const char *mask) -{ - ircdproto->SendSWhois(source, who, mask); -} - -void anope_SendEOB() -{ - ircdproto->SendEOB(); -} - -int anope_IsFloodModeParamValid(const char *value) -{ - return ircdproto->IsFloodModeParamValid(value); -} - -void anope_SendJupe(const char *jserver, const char *who, const char *reason) -{ - ircdproto->SendJupe(jserver, who, reason); -} - -int anope_IsNickValid(const char *nick) -{ - return ircdproto->IsNickValid(nick); -} - -int anope_IsChannelValid(const char *chan) -{ - return ircdproto->IsChannelValid(chan); -} - - -void anope_SendCTCP(const char *source, const char *dest, const char *fmt, ...) -{ - va_list args; - char buf[BUFSIZE] = ""; - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - // XXX: CBX, when you move this to ircdproto, please make it take BotInfo * directly, thx :) - ircdproto->SendCTCP(findbot(source), dest, buf); -} - void anope_SendNumeric(const char *source, int numeric, const char *dest, const char *fmt, ...) { va_list args; diff --git a/src/memoserv.c b/src/memoserv.c index 77661a79d..34e0061f9 100644 --- a/src/memoserv.c +++ b/src/memoserv.c @@ -6,8 +6,8 @@ * Please read COPYING and README for further details. * * Based on the original code of Epona by Lara. -* Based on the original code of Services by Andy Church. -* +* Based on the original code of Services by Andy Church. +* * $Id$ * */ @@ -63,7 +63,7 @@ void memoserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_MemoServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_MemoServ), u->nick, "PING %s", s); } else { if (!u->na && stricmp(cmd, "HELP") != 0) notice_lang(s_MemoServ, u, NICK_NOT_REGISTERED_HELP, diff --git a/src/messages.c b/src/messages.c index 6894cd43d..4b3f2bb94 100644 --- a/src/messages.c +++ b/src/messages.c @@ -71,7 +71,7 @@ int m_time(const char *source, int ac, const char **av) time(&t); tm = localtime(&t); strftime(buf, sizeof(buf), "%a %b %d %H:%M:%S %Y %Z", tm); - anope_SendNumeric(ServerName, 391, source, "%s :%s", ServerName, buf); + ircdproto->SendNumeric(ServerName, 391, source, "%s :%s", ServerName, buf); return MOD_CONT; } @@ -88,15 +88,15 @@ int m_motd(const char *source) f = fopen(MOTDFilename, "r"); if (f) { - anope_SendNumeric(ServerName, 375, source, ":- %s Message of the Day", ServerName); + ircdproto->SendNumeric(ServerName, 375, source, ":- %s Message of the Day", ServerName); while (fgets(buf, sizeof(buf), f)) { buf[strlen(buf) - 1] = 0; - anope_SendNumeric(ServerName, 372, source, ":- %s", buf); + ircdproto->SendNumeric(ServerName, 372, source, ":- %s", buf); } fclose(f); - anope_SendNumeric(ServerName, 376, source, ":End of /MOTD command."); + ircdproto->SendNumeric(ServerName, 376, source, ":End of /MOTD command."); } else { - anope_SendNumeric(ServerName, 422, source, ":- MOTD file not found! Please contact your IRC administrator."); + ircdproto->SendNumeric(ServerName, 422, source, ":- MOTD file not found! Please contact your IRC administrator."); } return MOD_CONT; } @@ -241,54 +241,54 @@ int m_stats(const char *source, int ac, const char **av) if (u && is_oper(u)) { if (servernum == 1) { - anope_SendNumeric(ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); - anope_SendNumeric(ServerName, 211, source, "%s %d %d %d %d %d %d %ld", RemoteServer, write_buffer_len(), total_written, -1, read_buffer_len(), + ircdproto->SendNumeric(ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); + ircdproto->SendNumeric(ServerName, 211, source, "%s %d %d %d %d %d %d %ld", RemoteServer, write_buffer_len(), total_written, -1, read_buffer_len(), total_read, -1, time(NULL) - start_time); } else if (servernum == 2) { - anope_SendNumeric(ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); - anope_SendNumeric(ServerName, 211, source, "%s %d %d %d %d %d %d %ld", RemoteServer2, write_buffer_len(), total_written, -1, read_buffer_len(), + ircdproto->SendNumeric(ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); + ircdproto->SendNumeric(ServerName, 211, source, "%s %d %d %d %d %d %d %ld", RemoteServer2, write_buffer_len(), total_written, -1, read_buffer_len(), total_read, -1, time(NULL) - start_time); } else if (servernum == 3) { - anope_SendNumeric(ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); - anope_SendNumeric(ServerName, 211, source, "%s %d %d %d %d %d %d %ld", RemoteServer3, write_buffer_len(), total_written, -1, read_buffer_len(), + ircdproto->SendNumeric(ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); + ircdproto->SendNumeric(ServerName, 211, source, "%s %d %d %d %d %d %d %ld", RemoteServer3, write_buffer_len(), total_written, -1, read_buffer_len(), total_read, -1, time(NULL) - start_time); } } - anope_SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); + ircdproto->SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); break; case 'o': case 'O': /* Check whether the user is an operator */ u = finduser(source); if (u && !is_oper(u) && HideStatsO) { - anope_SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); + ircdproto->SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); } else { for (i = 0; i < RootNumber; i++) - anope_SendNumeric(ServerName, 243, source, "O * * %s Root 0", ServicesRoots[i]); + ircdproto->SendNumeric(ServerName, 243, source, "O * * %s Root 0", ServicesRoots[i]); for (i = 0; i < servadmins.count && (nc = (NickCore *)servadmins.list[i]); i++) - anope_SendNumeric(ServerName, 243, source, "O * * %s Admin 0", nc->display); + ircdproto->SendNumeric(ServerName, 243, source, "O * * %s Admin 0", nc->display); for (i = 0; i < servopers.count && (nc = (NickCore *)servopers.list[i]); i++) - anope_SendNumeric(ServerName, 243, source, "O * * %s Oper 0", nc->display); + ircdproto->SendNumeric(ServerName, 243, source, "O * * %s Oper 0", nc->display); - anope_SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); + ircdproto->SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); } break; case 'u':{ int uptime = time(NULL) - start_time; - anope_SendNumeric(ServerName, 242, source, ":Services up %d day%s, %02d:%02d:%02d", uptime / 86400, uptime / 86400 == 1 ? "" : "s", + ircdproto->SendNumeric(ServerName, 242, source, ":Services up %d day%s, %02d:%02d:%02d", uptime / 86400, uptime / 86400 == 1 ? "" : "s", (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60); - anope_SendNumeric(ServerName, 250, source, ":Current users: %d (%d ops); maximum %d", usercnt, opcnt, maxusercnt); - anope_SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); + ircdproto->SendNumeric(ServerName, 250, source, ":Current users: %d (%d ops); maximum %d", usercnt, opcnt, maxusercnt); + ircdproto->SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); break; } /* case 'u' */ default: - anope_SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); + ircdproto->SendNumeric(ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*'); break; } return MOD_CONT; @@ -298,7 +298,7 @@ int m_stats(const char *source, int ac, const char **av) int m_version(const char *source, int ac, const char **av) { - if (source) anope_SendNumeric(ServerName, 351, source, "Anope-%s %s :%s - %s (%s) -- %s", version_number, ServerName, ircd->name, version_flags, + if (source) ircdproto->SendNumeric(ServerName, 351, source, "Anope-%s %s :%s - %s (%s) -- %s", version_number, ServerName, ircd->name, version_flags, EncModule, version_build); return MOD_CONT; } @@ -333,11 +333,11 @@ int m_whois(const char *source, const char *who) clientdesc = desc_DevNull; else if (s_BotServ && (bi = findbot(who))) { /* Bots are handled separately */ - anope_SendNumeric(ServerName, 311, source, "%s %s %s * :%s", bi->nick, bi->user, bi->host, bi->real); - anope_SendNumeric(ServerName, 307, source, "%s :is a registered nick", bi->nick); - anope_SendNumeric(ServerName, 312, source, "%s %s :%s", bi->nick, ServerName, ServerDesc); - anope_SendNumeric(ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick, time(NULL) - bi->lastmsg, start_time); - anope_SendNumeric(ServerName, 318, source, "%s :End of /WHOIS list.", who); + ircdproto->SendNumeric(ServerName, 311, source, "%s %s %s * :%s", bi->nick, bi->user, bi->host, bi->real); + ircdproto->SendNumeric(ServerName, 307, source, "%s :is a registered nick", bi->nick); + ircdproto->SendNumeric(ServerName, 312, source, "%s %s :%s", bi->nick, ServerName, ServerDesc); + ircdproto->SendNumeric(ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick, time(NULL) - bi->lastmsg, start_time); + ircdproto->SendNumeric(ServerName, 318, source, "%s :End of /WHOIS list.", who); return MOD_CONT; } else if (!(ircd->svshold && UseSVSHOLD) && (na = findnick(who)) && (na->status & NS_KILL_HELD)) { @@ -345,18 +345,18 @@ int m_whois(const char *source, const char *who) * We can't just say it doesn't exist here, even tho it does for * other servers :) -GD */ - anope_SendNumeric(ServerName, 311, source, "%s %s %s * :Services Enforcer", na->nick, NSEnforcerUser, NSEnforcerHost); - anope_SendNumeric(ServerName, 312, source, "%s %s :%s", na->nick, ServerName, ServerDesc); - anope_SendNumeric(ServerName, 318, source, "%s :End of /WHOIS list.", who); + ircdproto->SendNumeric(ServerName, 311, source, "%s %s %s * :Services Enforcer", na->nick, NSEnforcerUser, NSEnforcerHost); + ircdproto->SendNumeric(ServerName, 312, source, "%s %s :%s", na->nick, ServerName, ServerDesc); + ircdproto->SendNumeric(ServerName, 318, source, "%s :End of /WHOIS list.", who); return MOD_CONT; } else { - anope_SendNumeric(ServerName, 401, source, "%s :No such service.", who); + ircdproto->SendNumeric(ServerName, 401, source, "%s :No such service.", who); return MOD_CONT; } - anope_SendNumeric(ServerName, 311, source, "%s %s %s * :%s", who, ServiceUser, ServiceHost, clientdesc); - anope_SendNumeric(ServerName, 312, source, "%s %s :%s", who, ServerName, ServerDesc); - anope_SendNumeric(ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", who, time(NULL) - start_time, start_time); - anope_SendNumeric(ServerName, 318, source, "%s :End of /WHOIS list.", who); + ircdproto->SendNumeric(ServerName, 311, source, "%s %s %s * :%s", who, ServiceUser, ServiceHost, clientdesc); + ircdproto->SendNumeric(ServerName, 312, source, "%s %s :%s", who, ServerName, ServerDesc); + ircdproto->SendNumeric(ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", who, time(NULL) - start_time, start_time); + ircdproto->SendNumeric(ServerName, 318, source, "%s :End of /WHOIS list.", who); } return MOD_CONT; } diff --git a/src/modules/cs_appendtopic.c b/src/modules/cs_appendtopic.c index 12678cd7f..cbdae1533 100644 --- a/src/modules/cs_appendtopic.c +++ b/src/modules/cs_appendtopic.c @@ -147,7 +147,7 @@ int my_cs_appendtopic(User * u) s_ChanServ, u->nick, u->username, u->host, c->name); if (ircd->join2set) { if (whosends(ci) == s_ChanServ) { - ircdproto->SendJoin(s_ChanServ, c->name, c->creation_time); + ircdproto->SendJoin(findbot(s_ChanServ), c->name, c->creation_time); ircdproto->SendMode(NULL, c->name, "+o %s", s_ChanServ); } } diff --git a/src/nickserv.c b/src/nickserv.c index 32572a212..e4a48bd56 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -144,7 +144,7 @@ void nickserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_NickServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_NickServ), u->nick, "PING %s", s); } else { mod_run_cmd(s_NickServ, u, NICKSERV, cmd); } diff --git a/src/operserv.c b/src/operserv.c index 85e0f3dc7..d1613e365 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -141,7 +141,7 @@ void operserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { s = ""; } - anope_SendCTCP(s_OperServ, u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(s_OperServ), u->nick, "PING %s", s); } else { mod_run_cmd(s_OperServ, u, OPERSERV, cmd); } diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 0c8b0ebef..c82103cc8 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -452,11 +452,11 @@ CUMode myCumodes[128] = { -void BahamutIRCdProto::SendModeInternal(const char *source, const char *dest, const char *buf) +void BahamutIRCdProto::SendModeInternal(BotInfo *source, const char *dest, const char *buf) { if (!buf) return; - if (ircdcap->tsmode && (uplink_capab & ircdcap->tsmode)) send_cmd(source, "MODE %s 0 %s", dest, buf); - else send_cmd(source, "MODE %s %s", dest, buf); + if (ircdcap->tsmode && (uplink_capab & ircdcap->tsmode)) send_cmd(source->nick, "MODE %s 0 %s", dest, buf); + else send_cmd(source->nick, "MODE %s %s", dest, buf); } /* SVSHOLD - set */ @@ -488,7 +488,7 @@ void BahamutIRCdProto::SendSVSModeChan(const char *name, const char *mode, const void BahamutIRCdProto::SendBotOp(const char *nick, const char *chan) { - SendMode(nick, chan, "%s %s", ircd->botchanumode, nick); + SendMode(findbot(nick), chan, "%s %s", ircd->botchanumode, nick); } /* EVENT: SJOIN */ @@ -525,7 +525,7 @@ int anope_event_nick(const char *source, int ac, const char **av) strtoul(av[2], NULL, 10), strtoul(av[7], NULL, 0), strtoul(av[8], NULL, 0), NULL, NULL); if (user) { - anope_ProcessUsermodes(user, 1, &av[3]); + ircdproto->ProcessUsermodes(user, 1, &av[3]); } } else { do_nick(source, av[0], NULL, NULL, NULL, NULL, @@ -658,9 +658,9 @@ void BahamutIRCdProto::SendSQLineDel(const char *user) } /* JOIN - SJOIN */ -void BahamutIRCdProto::SendJoin(const char *user, const char *channel, time_t chantime) +void BahamutIRCdProto::SendJoin(BotInfo *user, const char *channel, time_t chantime) { - send_cmd(user, "SJOIN %ld %s", static_cast<long>(chantime), channel); + send_cmd(user->nick, "SJOIN %ld %s", static_cast<long>(chantime), channel); } void bahamut_cmd_burst() @@ -872,16 +872,16 @@ int anope_event_motd(const char *source, int ac, const char **av) return MOD_CONT; } -void BahamutIRCdProto::SendNoticeChanopsInternal(const char *source, const char *dest, const char *buf) +void BahamutIRCdProto::SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf) { if (!buf) return; send_cmd(NULL, "NOTICE @%s :%s", dest, buf); } -void BahamutIRCdProto::SendKickInternal(const char *source, const char *chan, const char *user, const char *buf) +void BahamutIRCdProto::SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf) { - if (buf) send_cmd(source, "KICK %s %s :%s", chan, user, buf); - else send_cmd(source, "KICK %s %s", chan, user); + if (buf) send_cmd(source->nick, "KICK %s %s :%s", chan, user, buf); + else send_cmd(source->nick, "KICK %s %s", chan, user); } int anope_event_away(const char *source, int ac, const char **av) diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index a1da77a92..200dc3d6a 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -60,9 +60,9 @@ class BahamutIRCdProto : public IRCDProto { void SendSVSKillInternal(const char *, const char *, const char *); - void SendModeInternal(const char *, const char *, const char *); - void SendKickInternal(const char *, const char *, const char *, const char *); - void SendNoticeChanopsInternal(const char *, const char *, const char *); + void SendModeInternal(BotInfo *, const char *, const char *); + void SendKickInternal(BotInfo *, const char *, const char *, const char *); + void SendNoticeChanopsInternal(BotInfo *, const char *, const char *); public: void SendSVSNOOP(const char *, int); void SendAkillDel(const char *, const char *); @@ -72,7 +72,7 @@ class BahamutIRCdProto : public IRCDProto { void SendGuestNick(const char *, const char *, const char *, const char *, const char *); void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); void SendBotOp(const char *, const char *); - void SendJoin(const char *, const char *, time_t); + void SendJoin(BotInfo *, const char *, time_t); void SendSQLineDel(const char *); void SendSQLine(const char *, const char *); void SendConnect(); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 7cc31bc56..0717b722c 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -489,14 +489,14 @@ int anope_event_nick(const char *source, int ac, const char **av) user = do_nick("", av[0], av[4], av[5], s->name, av[8], strtoul(av[2], NULL, 10), 0, 0, NULL, av[7]); if (user) { - anope_ProcessUsermodes(user, 1, &av[3]); + ircdproto->ProcessUsermodes(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, NULL); if (user) - anope_ProcessUsermodes(user, 1, &av[3]); + ircdproto->ProcessUsermodes(user, 1, &av[3]); } else { do_nick(source, av[0], NULL, NULL, NULL, NULL, strtoul(av[1], NULL, 10), 0, 0, NULL, NULL); @@ -533,7 +533,7 @@ int anope_event_euid(const char *source, int ac, const char **av) user = do_nick("", 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_ProcessUsermodes(user, 1, &av[3]); + ircdproto->ProcessUsermodes(user, 1, &av[3]); } } return MOD_CONT; @@ -694,10 +694,9 @@ void CharybdisProto::SendSQLineDel(const char *user) send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNRESV * %s", user); } -void CharybdisProto::SendJoin(const char *user, const char *channel, time_t chantime) +void CharybdisProto::SendJoin(BotInfo *user, const char *channel, time_t chantime) { - User *u = finduser(user); - send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, UseTS6 ? (u ? u->uid : user) : user); + send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, UseTS6 ? user->uid.c_str() : user->nick); } /* @@ -813,11 +812,10 @@ void CharybdisProto::SendClientIntroduction(const char *nick, const char *user, SendSQLine(nick, "Reserved for services"); } -void CharybdisProto::SendPartInternal(const char *nick, const char *chan, const char *buf) +void CharybdisProto::SendPartInternal(BotInfo *nick, const char *chan, const char *buf) { - User *u = finduser(nick); - if (buf) send_cmd(UseTS6 ? u->uid : nick, "PART %s :%s", chan, buf); - else send_cmd(UseTS6 ? |
