diff options
| author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 21:02:37 +0000 |
|---|---|---|
| committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 21:02:37 +0000 |
| commit | 6c305a3d6731191899f4331be56a071dab66d194 (patch) | |
| tree | 59a7bf69f0a2b035bc84580552e0745977307a82 | |
| parent | f3f1b97a1ab782a3419fe20ae06d3e3535a4ddae (diff) | |
Replaced anope_SendGlobops() with direct call to SendGlobops() in IRCDProto class.
Added SendGlobopsInternal() function to IRCDProto class, now SendGlobops() is a stub to handle varargs.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1347 5417fbe8-f217-4b02-8779-1006273d7864
52 files changed, 162 insertions, 164 deletions
diff --git a/include/extern.h b/include/extern.h index 0f1e8577f..1325ad2ba 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1118,7 +1118,6 @@ E void anope_cmd_chgident(const char *nick, const char *vIdent); E void anope_SendVhost(const char *nick, const char *vIdent, const char *vhost); /* CHGHOST + CHGIDENT */ E void anope_SendConnect(); /* Connect */ E void anope_cmd_ea(); /* EA */ -E void anope_SendGlobops(const char *source, const char *fmt, ...); /* GLOBOPS */ E void anope_cmd_tmode(const char *source, const char *dest, const char *fmt, ...); /* TMODE */ E void anope_SendBanDel(const char *name, const char *nick); /* MODE -b */ E void anope_cmd_netinfo(int ac, const char **av); /* NETINFO */ diff --git a/include/services.h b/include/services.h index 6fc0cf8cf..b9c81290e 100644 --- a/include/services.h +++ b/include/services.h @@ -1263,6 +1263,14 @@ class IRCDProto { else send_cmd(nick, "PART %s", chan); } + virtual void SendGlobopsInternal(const char *source, const char *buf) + { + BotInfo *bi = findbot(source); + if (bi) + send_cmd(UseTS6 ? bi->uid : bi->nick, "GLOBOPS :%s", buf); + else + send_cmd(ServerName, "GLOBOPS :%s", buf); + } public: virtual void SendSVSNOOP(const char *, int) { } virtual void SendAkillDel(const char *, const char *) = 0; @@ -1409,13 +1417,16 @@ class IRCDProto { } else SendPartInternal(nick, chan, NULL); } - virtual void SendGlobops(const char *source, const char *buf) + virtual void SendGlobops(const char *source, const char *fmt, ...) { - BotInfo *bi = findbot(source) - if (bi) - send_cmd(UseTS6 ? bi->uid : bi->nick, "GLOBOPS :%s", buf); - else - send_cmd(ServerName, "GLOBOPS :%s", buf); + va_list args; + char buf[BUFSIZE] = ""; + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + SendGlobopsInternal(source, buf); } virtual void SendSQLine(const char *, const char *) = 0; virtual void SendSquit(const char *servname, const char *message) diff --git a/src/botserv.c b/src/botserv.c index a473d20db..34cf3dc6c 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -491,7 +491,7 @@ void load_bs_dbase(void) restore_db(f); \ log_perror("Write error on %s", BotDBName); \ if (time(NULL) - lastwarn > WarningTimeout) { \ - anope_SendGlobops(NULL, "Write error on %s: %s", BotDBName, \ + ircdproto->SendGlobops(NULL, "Write error on %s: %s", BotDBName, \ strerror(errno)); \ lastwarn = time(NULL); \ } \ diff --git a/src/chanserv.c b/src/chanserv.c index 3472db927..a82de829a 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -611,7 +611,7 @@ void load_cs_dbase(void) restore_db(f); \ log_perror("Write error on %s", ChanDBName); \ if (time(NULL) - lastwarn > WarningTimeout) { \ - anope_SendGlobops(NULL, "Write error on %s: %s", ChanDBName, \ + ircdproto->SendGlobops(NULL, "Write error on %s: %s", ChanDBName, \ strerror(errno)); \ lastwarn = time(NULL); \ } \ @@ -876,7 +876,7 @@ void check_modes(Channel * c) /* Check for mode bouncing */ if (c->server_modecount >= 3 && c->chanserv_modecount >= 3) { - anope_SendGlobops(NULL, + ircdproto->SendGlobops(NULL, "Warning: unable to set modes on channel %s. " "Are your servers' U:lines configured correctly?", c->name); diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index 0b8eab366..93607ace1 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -117,7 +117,7 @@ int do_drop(User * u) * drop the channel before issuing the wallops. */ if (WallDrop && is_servadmin && level < ACCESS_FOUNDER) - anope_SendGlobops(s_ChanServ, + ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick, chan); diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index dc70d939f..f327237a8 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -118,7 +118,7 @@ int do_forbid(User * u) } if (WallForbid) - anope_SendGlobops(s_ChanServ, + ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick, ci->name); diff --git a/src/core/cs_getpass.c b/src/core/cs_getpass.c index de699e135..64113e5a6 100644 --- a/src/core/cs_getpass.c +++ b/src/core/cs_getpass.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$ * */ @@ -88,7 +88,7 @@ int do_getpass(User * u) alog("%s: %s!%s@%s used GETPASS on %s", s_ChanServ, u->nick, u->username, u->host, ci->name); if (WallGetpass) { - anope_SendGlobops(s_ChanServ, + ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used GETPASS on channel \2%s\2", u->nick, chan); } diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 67c1b5f99..43bf5d3e4 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.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$ * */ @@ -393,7 +393,7 @@ int do_set_password(User * u, ChannelInfo * ci, char *param) alog("%s: %s!%s@%s set password as Services admin for %s", s_ChanServ, u->nick, u->username, u->host, ci->name); if (WallSetpass) - anope_SendGlobops(s_ChanServ, + ircdproto->SendGlobops(s_ChanServ, "\2%s\2 set password as Services admin for channel \2%s\2", u->nick, ci->name); } else { diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c index f97b5c54a..67011209a 100644 --- a/src/core/cs_suspend.c +++ b/src/core/cs_suspend.c @@ -133,7 +133,7 @@ int do_suspend(User * u) } if (WallForbid) - anope_SendGlobops(s_ChanServ, + ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used SUSPEND on channel \2%s\2", u->nick, ci->name); @@ -194,7 +194,7 @@ int do_unsuspend(User * u) } if (WallForbid) - anope_SendGlobops(s_ChanServ, + ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick, ci->name); diff --git a/src/core/ns_drop.c b/src/core/ns_drop.c index a9a78bd42..bd12cdbbf 100644 --- a/src/core/ns_drop.c +++ b/src/core/ns_drop.c @@ -88,7 +88,7 @@ int do_drop(User * u) if (readonly) notice_lang(s_NickServ, u, READ_ONLY_MODE); if (WallDrop) - anope_SendGlobops(s_NickServ, + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used DROP on \2%s\2", u->nick, nick); alog("%s: %s!%s@%s dropped nickname %s (e-mail: %s)", @@ -132,7 +132,7 @@ int do_drop(User * u) if (!is_mine) { if (WallDrop) - anope_SendGlobops(s_NickServ, "\2%s\2 used DROP on \2%s\2", + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used DROP on \2%s\2", u->nick, nick); notice_lang(s_NickServ, u, NICK_X_DROPPED, nick); } else { diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c index 8160b220d..eb78b256e 100644 --- a/src/core/ns_forbid.c +++ b/src/core/ns_forbid.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$ * */ @@ -119,7 +119,7 @@ int do_forbid(User * u) } if (WallForbid) - anope_SendGlobops(s_NickServ, "\2%s\2 used FORBID on \2%s\2", + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used FORBID on \2%s\2", u->nick, nick); alog("%s: %s set FORBID for nick %s", s_NickServ, u->nick, nick); diff --git a/src/core/ns_getpass.c b/src/core/ns_getpass.c index 6079ca2ba..35589211c 100644 --- a/src/core/ns_getpass.c +++ b/src/core/ns_getpass.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$ * */ @@ -80,7 +80,7 @@ int do_getpass(User * u) alog("%s: %s!%s@%s used GETPASS on %s", s_NickServ, u->nick, u->username, u->host, nick); if (WallGetpass) - anope_SendGlobops(s_NickServ, + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick, nick); notice_lang(s_NickServ, u, NICK_GETPASS_PASSCODE_IS, nick, @@ -100,7 +100,7 @@ int do_getpass(User * u) alog("%s: %s!%s@%s used GETPASS on %s", s_NickServ, u->nick, u->username, u->host, nick); if (WallGetpass) - anope_SendGlobops(s_NickServ, "\2%s\2 used GETPASS on \2%s\2", + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick, nick); notice_lang(s_NickServ, u, NICK_GETPASS_PASSWORD_IS, nick, tmp_pass); diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c index cfa6bd0a4..9383c5c52 100644 --- a/src/core/ns_saset.c +++ b/src/core/ns_saset.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: ns_set.c 850 2005-08-07 14:52:04Z geniusdex $ * */ @@ -183,7 +183,7 @@ int do_saset(User * u) } else if (stricmp(cmd, "NOEXPIRE") == 0) { do_saset_noexpire(u, na, param); } else if (stricmp(cmd, "AUTOOP") == 0) { - do_saset_autoop(u, na->nc, param); + do_saset_autoop(u, na->nc, param); } else if (stricmp(cmd, "LANGUAGE") == 0) { do_saset_language(u, na->nc, param); } else { @@ -261,7 +261,7 @@ int do_saset_password(User * u, NickCore * nc, char *param) u->nick, u->username, u->host, nc->display, (nc->email ? nc->email : "none")); if (WallSetpass) - anope_SendGlobops(s_NickServ, + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used SASET PASSWORD on \2%s\2", u->nick, nc->display); return MOD_CONT; diff --git a/src/core/ns_suspend.c b/src/core/ns_suspend.c index 53823f75f..7394015d4 100644 --- a/src/core/ns_suspend.c +++ b/src/core/ns_suspend.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$ * */ @@ -119,7 +119,7 @@ int do_suspend(User * u) } if (WallForbid) - anope_SendGlobops(s_NickServ, "\2%s\2 used SUSPEND on \2%s\2", + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used SUSPEND on \2%s\2", u->nick, nick); alog("%s: %s set SUSPEND for nick %s", s_NickServ, u->nick, nick); @@ -172,7 +172,7 @@ int do_unsuspend(User * u) na->nc->flags &= ~NI_SUSPENDED; if (WallForbid) - anope_SendGlobops(s_NickServ, "\2%s\2 used UNSUSPEND on \2%s\2", + ircdproto->SendGlobops(s_NickServ, "\2%s\2 used UNSUSPEND on \2%s\2", u->nick, nick); alog("%s: %s set UNSUSPEND for nick %s", s_NickServ, u->nick, diff --git a/src/core/os_akill.c b/src/core/os_akill.c index d2250fef2..5c142f71e 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.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$ * */ @@ -178,7 +178,7 @@ int do_akill(User * u) (wall_expiry == 1) ? "" : "s"); } - anope_SendGlobops(s_OperServ, + ircdproto->SendGlobops(s_OperServ, "%s added an AKILL for %s (%s) (%s)", u->nick, mask, reason, buf); } diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c index c92a6e481..16ea99071 100644 --- a/src/core/os_chankill.c +++ b/src/core/os_chankill.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$ * */ @@ -68,7 +68,7 @@ void myOperServHelp(User * u) * * /msg OperServ ChanKill +expire #channel reason * @param u The user who issued the command - * @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing. + * @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing. * **/ int do_chankill(User * u) @@ -118,7 +118,7 @@ int do_chankill(User * u) cu->user->host, NULL, NULL); } if (WallOSAkill) { - anope_SendGlobops(s_OperServ, "%s used CHANKILL on %s (%s)", + ircdproto->SendGlobops(s_OperServ, "%s used CHANKILL on %s (%s)", u->nick, channel, reason); } } else { diff --git a/src/core/os_clearmodes.c b/src/core/os_clearmodes.c index 23c4a2993..214404e3d 100644 --- a/src/core/os_clearmodes.c +++ b/src/core/os_clearmodes.c @@ -99,7 +99,7 @@ int do_clearmodes(User * u) } if (WallOSClearmodes) { - anope_SendGlobops(s_OperServ, "%s used CLEARMODES%s on %s", + ircdproto->SendGlobops(s_OperServ, "%s used CLEARMODES%s on %s", u->nick, all ? " ALL" : "", chan); } if (all) { diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c index e2ab6da80..4b6079d20 100644 --- a/src/core/os_defcon.c +++ b/src/core/os_defcon.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$ * */ @@ -105,7 +105,7 @@ int do_defcon(User * u) notice_lang(s_OperServ, u, OPER_DEFCON_CHANGED, DefConLevel); defcon_sendlvls(u); alog("Defcon level changed to %d by Oper %s", newLevel, u->nick); - anope_SendGlobops(s_OperServ, getstring2(NULL, OPER_DEFCON_WALL), + ircdproto->SendGlobops(s_OperServ, getstring2(NULL, OPER_DEFCON_WALL), u->nick, newLevel); /* Global notice the user what is happening. Also any Message that the Admin would like to add. Set in config file. */ diff --git a/src/core/os_global.c b/src/core/os_global.c index befaf881c..4258b8df1 100644 --- a/src/core/os_global.c +++ b/src/core/os_global.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$ * */ @@ -75,7 +75,7 @@ int do_global(User * u) return MOD_CONT; } if (WallOSGlobal) - anope_SendGlobops(s_OperServ, "\2%s\2 just used GLOBAL command.", + ircdproto->SendGlobops(s_OperServ, "\2%s\2 just used GLOBAL command.", u->nick); oper_global(u->nick, "%s", msg); return MOD_CONT; diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c index 928da7ef9..5cab65795 100644 --- a/src/core/os_jupe.c +++ b/src/core/os_jupe.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$ * */ @@ -80,7 +80,7 @@ int do_jupe(User * u) anope_SendJupe(jserver, u->nick, reason); if (WallOSJupe) - anope_SendGlobops(s_OperServ, "\2%s\2 used JUPE on \2%s\2", + ircdproto->SendGlobops(s_OperServ, "\2%s\2 used JUPE on \2%s\2", u->nick, jserver); } } diff --git a/src/core/os_kick.c b/src/core/os_kick.c index af3d58496..f1ce4a072 100644 --- a/src/core/os_kick.c +++ b/src/core/os_kick.c @@ -87,7 +87,7 @@ int do_os_kick(User * u) } ircdproto->SendKick(s_OperServ, chan, nick, "%s (%s)", u->nick, s); if (WallOSKick) - anope_SendGlobops(s_OperServ, "%s used KICK on %s/%s", u->nick, + ircdproto->SendGlobops(s_OperServ, "%s used KICK on %s/%s", u->nick, nick, chan); argv[0] = sstrdup(chan); argv[1] = sstrdup(nick); diff --git a/src/core/os_mode.c b/src/core/os_mode.c index 43cd96f9f..60d4f4fcf 100644 --- a/src/core/os_mode.c +++ b/src/core/os_mode.c @@ -95,7 +95,7 @@ int do_os_mode(User * u) free(av); if (WallOSMode) - anope_SendGlobops(s_OperServ, "%s used MODE %s on %s", u->nick, + ircdproto->SendGlobops(s_OperServ, "%s used MODE %s on %s", u->nick, modes, chan); } return MOD_CONT; diff --git a/src/core/os_noop.c b/src/core/os_noop.c index e406065d2..65eff229f 100644 --- a/src/core/os_noop.c +++ b/src/core/os_noop.c @@ -84,7 +84,7 @@ int do_noop(User * u) snprintf(reason, sizeof(reason), "NOOP command used by %s", u->nick); if (WallOSNoOp) - anope_SendGlobops(s_OperServ, "\2%s\2 used NOOP on \2%s\2", + ircdproto->SendGlobops(s_OperServ, "\2%s\2 used NOOP on \2%s\2", u->nick, server); notice_lang(s_OperServ, u, OPER_NOOP_SET, server); diff --git a/src/core/os_oline.c b/src/core/os_oline.c index 9ae96a39c..31ecfef00 100644 --- a/src/core/os_oline.c +++ b/src/core/os_oline.c @@ -94,12 +94,12 @@ int do_operoline(User * u) common_svsmode(u2, "+o", NULL); notice_lang(s_OperServ, u2, OPER_OLINE_IRCOP); notice_lang(s_OperServ, u, OPER_OLINE_SUCCESS, flags, nick); - anope_SendGlobops(s_OperServ, "\2%s\2 used OLINE for %s", + ircdproto->SendGlobops(s_OperServ, "\2%s\2 used OLINE for %s", u->nick, nick); } else if (u2 && flags[0] == '-') { anope_SendSVSO(s_OperServ, nick, flags); notice_lang(s_OperServ, u, OPER_OLINE_SUCCESS, flags, nick); - anope_SendGlobops(s_OperServ, "\2%s\2 used OLINE for %s", + ircdproto->SendGlobops(s_OperServ, "\2%s\2 used OLINE for %s", u->nick, nick); } else syntax_error(s_OperServ, u, "OLINE", OPER_OLINE_SYNTAX); diff --git a/src/core/os_raw.c b/src/core/os_raw.c index 6628adb9d..142a44980 100644 --- a/src/core/os_raw.c +++ b/src/core/os_raw.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$ * */ @@ -67,7 +67,7 @@ int do_raw(User * u) char *kw = strtok(text, " "); while (kw && *kw == ':') kw = strtok(NULL, " "); - anope_SendGlobops(s_OperServ, + ircdproto->SendGlobops(s_OperServ, "\2%s\2 used RAW command for \2%s\2", u->nick, (kw ? kw : "\2non RFC compliant message\2")); diff --git a/src/core/os_set.c b/src/core/os_set.c index 28d66fe5c..a8091bf95 100644 --- a/src/core/os_set.c +++ b/src/core/os_set.c @@ -214,14 +214,14 @@ int do_set(User * u) u->isSuperAdmin = 1; notice_lang(s_OperServ, u, OPER_SUPER_ADMIN_ON); alog("%s: %s is a SuperAdmin ", s_OperServ, u->nick); - anope_SendGlobops(s_OperServ, + ircdproto-& |
