diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:12 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:12 +0000 |
commit | a587cdc9987b0b8f4c86caa70f1bca741a69145d (patch) | |
tree | a3701adf69225092c0023c813e7f15b2b96d9971 | |
parent | 34afc576d7b3f43cf099b8cb28e86a4740bf41f1 (diff) |
Added cmd_ctcp() function to IRCDProtoNew class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1263 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/services.h | 8 | ||||
-rw-r--r-- | src/ircd.c | 23 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 14 | ||||
-rw-r--r-- | src/protocol/bahamut.h | 1 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 15 | ||||
-rw-r--r-- | src/protocol/charybdis.h | 1 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 16 | ||||
-rwxr-xr-x | src/protocol/inspircd11.h | 1 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 16 | ||||
-rw-r--r-- | src/protocol/ratbox.h | 1 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 14 | ||||
-rw-r--r-- | src/protocol/unreal32.h | 1 |
13 files changed, 15 insertions, 97 deletions
diff --git a/include/extern.h b/include/extern.h index ef576cf05..c13bfa7a6 100644 --- a/include/extern.h +++ b/include/extern.h @@ -623,7 +623,6 @@ E void pmodule_cmd_318(void (*func) (const char *source, const char *who)); E void pmodule_cmd_242(void (*func) (const char *buf)); E void pmodule_cmd_243(void (*func) (const char *buf)); E void pmodule_cmd_211(void (*func) (const char *buf)); -E void pmodule_cmd_ctcp(void (*func) (const char *source, const char *dest, const char *buf)); E void pmodule_cmd_svsjoin(void (*func) (const char *source, const char *nick, const char *chan, const char *param)); E void pmodule_cmd_svspart(void (*func) (const char *source, const char *nick, const char *chan)); E void pmodule_cmd_swhois(void (*func) (const char *source, const char *who, const char *mask)); diff --git a/include/services.h b/include/services.h index 2e8eecce2..f394f0cb2 100644 --- a/include/services.h +++ b/include/services.h @@ -1073,7 +1073,6 @@ typedef struct ircd_proto_ { void (*ircd_cmd_242)(const char *buf); void (*ircd_cmd_243)(const char *buf); void (*ircd_cmd_211)(const char *buf); - void (*ircd_cmd_ctcp)(const char *source, const char *dest, const char *buf); void (*ircd_cmd_svsjoin)(const char *source, const char *nick, const char *chan, const char *param); void (*ircd_cmd_svspart)(const char *source, const char *nick, const char *chan); void (*ircd_cmd_swhois)(const char *source, const char *who, const char *mask); @@ -1358,6 +1357,13 @@ class IRCDProtoNew { virtual void cmd_nc_change(User *) { } virtual void cmd_svid_umode2(User *, const char *) { } virtual void cmd_svid_umode3(User *, const char *) { } + virtual void cmd_ctcp(const char *source, const char *dest, const char *buf) + { + if (!buf) return; + char *s = normalizeBuffer(buf); + send_cmd(source, "NOTICE %s :\1%s\1", dest, s); + free(s); + } }; /*************************************************************************/ diff --git a/src/ircd.c b/src/ircd.c index 52893c8f6..de304e485 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -71,7 +71,6 @@ void initIrcdProto() ircdproto.ircd_cmd_jupe = NULL; ircdproto.ircd_valid_nick = NULL; ircdproto.ircd_valid_chan = NULL; - ircdproto.ircd_cmd_ctcp = NULL; } /* Special function, returns 1 if executed, 0 if not */ @@ -586,15 +585,14 @@ int anope_valid_chan(const char *chan) void anope_cmd_ctcp(const char *source, const char *dest, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - ircdproto.ircd_cmd_ctcp(source, dest, buf); + va_list args; + char buf[BUFSIZE] = ""; + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + ircdprotonew->cmd_ctcp(source, dest, buf); } @@ -693,11 +691,6 @@ void pmodule_cmd_211(void (*func) (const char *buf)) ircdproto.ircd_cmd_211 = func; } -void pmodule_cmd_ctcp(void (*func) (const char *source, const char *dest, const char *buf)) -{ - ircdproto.ircd_cmd_ctcp = func; -} - void pmodule_cmd_svsjoin(void (*func) (const char *source, const char *nick, const char *chan, const char *param)) diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 6b582fb5b..87ca850d8 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -1336,19 +1336,6 @@ int bahamut_valid_chan(const char *chan) return 1; } -void bahamut_cmd_ctcp(const char *source, const char *dest, const char *buf) -{ - char *s; - if (!buf) { - return; - } else { - s = normalizeBuffer(buf); - } - - send_cmd(source, "NOTICE %s :\1%s \1", dest, s); - free(s); -} - /* this avoids "undefined symbol" messages of those whom try to load mods that call on this function */ void bahamut_cmd_chghost(const char *nick, const char *vhost) @@ -1389,7 +1376,6 @@ void moduleAddAnopeCmds() pmodule_cmd_jupe(bahamut_cmd_jupe); pmodule_valid_nick(bahamut_valid_nick); pmodule_valid_chan(bahamut_valid_chan); - pmodule_cmd_ctcp(bahamut_cmd_ctcp); pmodule_set_umode(bahamut_set_umode); } diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index 3d4364c19..c81293283 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -80,7 +80,6 @@ void bahamut_cmd_eob(); int bahamut_flood_mode_check(const char *value); void bahamut_cmd_jupe(const char *jserver, const char *who, const char *reason); int bahamut_valid_nick(const char *nick); -void bahamut_cmd_ctcp(const char *source, const char *dest, const char *buf); class BahamutIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 7996b849f..7e2800637 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -1562,20 +1562,6 @@ int charybdis_valid_chan(const char *chan) } -void charybdis_cmd_ctcp(const char *source, const char *dest, const char *buf) -{ - char *s; - - if (!buf) { - return; - } else { - s = normalizeBuffer(buf); - } - - send_cmd(source, "NOTICE %s :\1%s \1", dest, s); - free(s); -} - int charybdis_send_account(int argc, char **argv) { send_cmd((UseTS6 ? TS6SID : ServerName), "ENCAP * SU %s :%s", @@ -1625,7 +1611,6 @@ void moduleAddAnopeCmds() pmodule_cmd_jupe(charybdis_cmd_jupe); pmodule_valid_nick(charybdis_valid_nick); pmodule_valid_chan(charybdis_valid_chan); - pmodule_cmd_ctcp(charybdis_cmd_ctcp); pmodule_set_umode(charybdis_set_umode); } diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index d7a948f86..e5330dfa9 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -68,7 +68,6 @@ void charybdis_cmd_eob(); int charybdis_flood_mode_check(const char *value); void charybdis_cmd_jupe(const char *jserver, const char *who, const char *reason); int charybdis_valid_nick(const char *nick); -void charybdis_cmd_ctcp(const char *source, const char *dest, const char *buf); class CharybdisProto : public IRCDProtoNew { public: diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 8ba0dd713..511a1dee1 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -1566,21 +1566,6 @@ int inspircd_valid_chan(const char *chan) } -void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf) -{ - char *s; - - if (!buf) { - return; - } else { - s = normalizeBuffer(buf); - } - - send_cmd(source, "NOTICE %s :\1%s\1", dest, s); - free(s); -} - - /** * Tell anope which function we want to perform each task inside of anope. * These prototypes must match what anope expects. @@ -1612,7 +1597,6 @@ void moduleAddAnopeCmds() pmodule_cmd_jupe(inspircd_cmd_jupe); pmodule_valid_nick(inspircd_valid_nick); pmodule_valid_chan(inspircd_valid_chan); - pmodule_cmd_ctcp(inspircd_cmd_ctcp); pmodule_set_umode(inspircd_set_umode); } diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index 780271d81..19abfad0a 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -73,7 +73,6 @@ void inspircd_cmd_eob(); int inspircd_flood_mode_check(const char *value); void inspircd_cmd_jupe(const char *jserver, const char *who, const char *reason); int inspircd_valid_nick(const char *nick); -void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf); int anope_event_fjoin(const char *source, int ac, const char **av); int anope_event_fmode(const char *source, int ac, const char **av); int anope_event_ftopic(const char *source, int ac, const char **av); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index e2bbb367d..680e0c49f 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -1457,21 +1457,6 @@ int ratbox_valid_chan(const char *chan) } -void ratbox_cmd_ctcp(const char *source, const char *dest, const char *buf) -{ - char *s; - - if (!buf) { - return; - } else { - s = normalizeBuffer(buf); - } - - send_cmd(source, "NOTICE %s :\1%s \1", dest, s); - free(s); -} - - /** * Tell anope which function we want to perform each task inside of anope. * These prototypes must match what anope expects. @@ -1503,7 +1488,6 @@ void moduleAddAnopeCmds() pmodule_cmd_jupe(ratbox_cmd_jupe); pmodule_valid_nick(ratbox_valid_nick); pmodule_valid_chan(ratbox_valid_chan); - pmodule_cmd_ctcp(ratbox_cmd_ctcp); pmodule_set_umode(ratbox_set_umode); } diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index f179d48d9..1c2385392 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -67,7 +67,6 @@ void ratbox_cmd_eob(); int ratbox_flood_mode_check(const char *value); void ratbox_cmd_jupe(const char *jserver, const char *who, const char *reason); int ratbox_valid_nick(const char *nick); -void ratbox_cmd_ctcp(const char *source, const char *dest, const char *buf); class RatboxProto : public IRCDProtoNew { public: diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 2839fac9d..baf645473 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -1622,19 +1622,6 @@ int unreal_valid_chan(const char *chan) { return 1; } -void unreal_cmd_ctcp(const char *source, const char *dest, const char *buf) -{ - char *s; - if (!buf) { - return; - } else { - s = normalizeBuffer(buf); - } - - send_cmd(source, "%s %s :\1%s \1", send_token("NOTICE", "B"), dest, s); - free(s); -} - /* *INDENT-OFF* */ void moduleAddIRCDMsgs(void) { Message *m; @@ -1924,7 +1911,6 @@ void moduleAddAnopeCmds() pmodule_cmd_jupe(unreal_cmd_jupe); pmodule_valid_nick(unreal_valid_nick); pmodule_valid_chan(unreal_valid_chan); - pmodule_cmd_ctcp(unreal_cmd_ctcp); pmodule_set_umode(unreal_set_umode); } diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index 1f77f79b0..96a6664c0 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -102,7 +102,6 @@ void unreal_cmd_eob(); int unreal_flood_mode_check(const char *value); void unreal_cmd_jupe(const char *jserver, const char *who, const char *reason); int unreal_valid_nick(const char *nick); -void unreal_cmd_ctcp(const char *source, const char *dest, const char *buf); class UnrealIRCdProto : public IRCDProtoNew { public: |