diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:11 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:11 +0000 |
commit | d1004fe1a46c9f14555ee3b9832c00a696cde0fe (patch) | |
tree | 5dafb7c149850200c80b073dd70fa30749d9484b | |
parent | 8705fed8d72a93e34a8b8759bcb42d73f9106370 (diff) |
Added cmd_invite() function to IRCDProtoNew class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1240 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/services.h | 6 | ||||
-rw-r--r-- | src/ircd.c | 9 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 11 | ||||
-rw-r--r-- | src/protocol/bahamut.h | 1 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 19 | ||||
-rw-r--r-- | src/protocol/charybdis.h | 2 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 11 | ||||
-rwxr-xr-x | src/protocol/inspircd11.h | 1 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 19 | ||||
-rw-r--r-- | src/protocol/ratbox.h | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 11 | ||||
-rw-r--r-- | src/protocol/unreal32.h | 1 |
13 files changed, 18 insertions, 76 deletions
diff --git a/include/extern.h b/include/extern.h index dbf51161f..652470102 100644 --- a/include/extern.h +++ b/include/extern.h @@ -611,7 +611,6 @@ E void pmodule_cmd_372_error(void (*func) (const char *source)); E void pmodule_cmd_375(void (*func) (const char *source)); E void pmodule_cmd_376(void (*func) (const char *source)); E void pmodule_cmd_351(void (*func) (const char *source)); -E void pmodule_cmd_invite(void (*func) (const char *source, const char *chan, const char *nick)); E void pmodule_cmd_part(void (*func) (const char *nick, const char *chan, const char *buf)); E void pmodule_cmd_391(void (*func) (const char *source, const char *timestr)); E void pmodule_cmd_250(void (*func) (const char *buf)); diff --git a/include/services.h b/include/services.h index 778d443b3..af922e026 100644 --- a/include/services.h +++ b/include/services.h @@ -1061,7 +1061,6 @@ typedef struct ircd_proto_ { void (*ircd_cmd_375)(const char *source); void (*ircd_cmd_376)(const char *source); void (*ircd_cmd_351)(const char *source); - void (*ircd_cmd_invite)(const char *source, const char *chan, const char *nick); void (*ircd_cmd_part)(const char *nick, const char *chan, const char *buf); void (*ircd_cmd_391)(const char *source, const char *timestr); void (*ircd_cmd_250)(const char *buf); @@ -1333,6 +1332,11 @@ class IRCDProtoNew { } virtual void cmd_join(const char *, const char *, time_t) = 0; virtual void cmd_unsqline(const char *) = 0; + virtual void cmd_invite(const char *source, const char *chan, const char *nick) + { + if (!source || !chan || !nick) return; + send_cmd(source, "INVITE %s %s", nick, chan); + } }; /*************************************************************************/ diff --git a/src/ircd.c b/src/ircd.c index bdc2646ae..348d1ba61 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -51,7 +51,6 @@ void initIrcdProto() ircdproto.ircd_cmd_375 = NULL; ircdproto.ircd_cmd_376 = NULL; ircdproto.ircd_cmd_351 = NULL; - ircdproto.ircd_cmd_invite = NULL; ircdproto.ircd_cmd_part = NULL; ircdproto.ircd_cmd_391 = NULL; ircdproto.ircd_cmd_250 = NULL; @@ -318,7 +317,7 @@ void anope_cmd_unsqline(const char *user) void anope_cmd_invite(const char *source, const char *chan, const char *nick) { - ircdproto.ircd_cmd_invite(source, chan, nick); + ircdprotonew->cmd_invite(source, chan, nick); } void anope_cmd_part(const char *nick, const char *chan, const char *fmt, ...) @@ -658,12 +657,6 @@ void pmodule_cmd_351(void (*func) (const char *source)) ircdproto.ircd_cmd_351 = func; } -void -pmodule_cmd_invite(void (*func) (const char *source, const char *chan, const char *nick)) -{ - ircdproto.ircd_cmd_invite = func; -} - void pmodule_cmd_part(void (*func) (const char *nick, const char *chan, const char *buf)) { ircdproto.ircd_cmd_part = func; diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 96d0e9167..713e59d98 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -1190,16 +1190,6 @@ void bahamut_cmd_376(const char *source) send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -/* INVITE */ -void bahamut_cmd_invite(const char *source, const char *chan, const char *nick) -{ - if (!source || !chan || !nick) { - return; - } - - send_cmd(source, "INVITE %s %s", nick, chan); -} - int anope_event_away(const char *source, int ac, const char **av) { if (!source) { @@ -1473,7 +1463,6 @@ void moduleAddAnopeCmds() pmodule_cmd_375(bahamut_cmd_375); pmodule_cmd_376(bahamut_cmd_376); pmodule_cmd_351(bahamut_cmd_351); - pmodule_cmd_invite(bahamut_cmd_invite); pmodule_cmd_part(bahamut_cmd_part); pmodule_cmd_391(bahamut_cmd_391); pmodule_cmd_250(bahamut_cmd_250); diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index 2f5e15312..a2ea3a88d 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -64,7 +64,6 @@ void bahamut_cmd_372_error(const char *source); void bahamut_cmd_375(const char *source); void bahamut_cmd_376(const char *source); void bahamut_cmd_351(const char *source); -void bahamut_cmd_invite(const char *source, const char *chan, const char *nick); void bahamut_cmd_part(const char *nick, const char *chan, const char *buf); void bahamut_cmd_391(const char *source, const char *timestr); void bahamut_cmd_250(const char *buf); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 1007d9b0a..bc81e1456 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -1355,20 +1355,12 @@ void CharybdisProto::cmd_pong(const char *servname, const char *who) } /* INVITE */ -void charybdis_cmd_invite(const char *source, const char *chan, const char *nick) +void CharybdisProto::cmd_invite(const char *source, const char *chan, const char *nick) { - Uid *ud; - User *u; - - if (!source || !chan || !nick) { - return; - } - - ud = find_uid(source); - u = finduser(nick); - - send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "INVITE %s %s", - (UseTS6 ? (u ? u->uid : nick) : nick), chan); + if (!source || !chan || !nick) return; + Uid *ud = find_uid(source); + User *u = finduser(nick); + send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "INVITE %s %s", UseTS6 ? (u ? u->uid : nick) : nick, chan); } /* SQUIT */ @@ -1723,7 +1715,6 @@ void moduleAddAnopeCmds() pmodule_cmd_375(charybdis_cmd_375); pmodule_cmd_376(charybdis_cmd_376); pmodule_cmd_351(charybdis_cmd_351); - pmodule_cmd_invite(charybdis_cmd_invite); pmodule_cmd_part(charybdis_cmd_part); pmodule_cmd_391(charybdis_cmd_391); pmodule_cmd_250(charybdis_cmd_250); diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index 5884967c7..60f5e3676 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -52,7 +52,6 @@ void charybdis_cmd_372_error(const char *source); void charybdis_cmd_375(const char *source); void charybdis_cmd_376(const char *source); void charybdis_cmd_351(const char *source); -void charybdis_cmd_invite(const char *source, const char *chan, const char *nick); void charybdis_cmd_part(const char *nick, const char *chan, const char *buf); void charybdis_cmd_391(const char *source, const char *timestr); void charybdis_cmd_250(const char *buf); @@ -113,4 +112,5 @@ class CharybdisProto : public IRCDProtoNew { void cmd_pong(const char *, const char *); void cmd_join(const char *, const char *, time_t); void cmd_unsqline(const char *); + void cmd_invite(const char *, const char *, const char *); } ircd_proto; diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index d4b959bbc..93d245cdb 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -838,16 +838,6 @@ void inspircd_cmd_chgident(const char *nick, const char *vIdent) } } -/* INVITE */ -void inspircd_cmd_invite(const char *source, const char *chan, const char *nick) -{ - if (!source || !chan || !nick) { - return; - } - - send_cmd(source, "INVITE %s %s", nick, chan); -} - /* PART */ void inspircd_cmd_part(const char *nick, const char *chan, const char *buf) { @@ -1717,7 +1707,6 @@ void moduleAddAnopeCmds() pmodule_cmd_375(inspircd_cmd_375); pmodule_cmd_376(inspircd_cmd_376); pmodule_cmd_351(inspircd_cmd_351); - pmodule_cmd_invite(inspircd_cmd_invite); pmodule_cmd_part(inspircd_cmd_part); pmodule_cmd_391(inspircd_cmd_391); pmodule_cmd_250(inspircd_cmd_250); diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index 6fca56a64..39549f9db 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -57,7 +57,6 @@ void inspircd_cmd_372_error(const char *source); void inspircd_cmd_375(const char *source); void inspircd_cmd_376(const char *source); void inspircd_cmd_351(const char *source); -void inspircd_cmd_invite(const char *source, const char *chan, const char *nick); void inspircd_cmd_part(const char *nick, const char *chan, const char *buf); void inspircd_cmd_391(const char *source, const char *timestr); void inspircd_cmd_250(const char *buf); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index c872d4ca5..4b11f6bd4 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -1286,20 +1286,12 @@ void RatboxProto::cmd_pong(const char *servname, const char *who) } /* INVITE */ -void ratbox_cmd_invite(const char *source, const char *chan, const char *nick) +void RatboxProto::cmd_invite(const char *source, const char *chan, const char *nick) { - Uid *ud; - User *u; - - if (!source || !chan || !nick) { - return; - } - - ud = find_uid(source); - u = finduser(nick); - - send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "INVITE %s %s", - (UseTS6 ? (u ? u->uid : nick) : nick), chan); + if (!source || !chan || !nick) return; + Uid *ud = find_uid(source); + User *u = finduser(nick); + send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "INVITE %s %s", UseTS6 ? (u ? u->uid : nick) : nick, chan); } /* SQUIT */ @@ -1617,7 +1609,6 @@ void moduleAddAnopeCmds() pmodule_cmd_375(ratbox_cmd_375); pmodule_cmd_376(ratbox_cmd_376); pmodule_cmd_351(ratbox_cmd_351); - pmodule_cmd_invite(ratbox_cmd_invite); pmodule_cmd_part(ratbox_cmd_part); pmodule_cmd_391(ratbox_cmd_391); pmodule_cmd_250(ratbox_cmd_250); diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index 0baa21ca6..bbf6c972e 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -51,7 +51,6 @@ void ratbox_cmd_372_error(const char *source); void ratbox_cmd_375(const char *source); void ratbox_cmd_376(const char *source); void ratbox_cmd_351(const char *source); -void ratbox_cmd_invite(const char *source, const char *chan, const char *nick); void ratbox_cmd_part(const char *nick, const char *chan, const char *buf); void ratbox_cmd_391(const char *source, const char *timestr); void ratbox_cmd_250(const char *buf); @@ -111,4 +110,5 @@ class RatboxProto : public IRCDProtoNew { void cmd_pong(const char *, const char *); void cmd_join(const char *, const char *, time_t); void cmd_unsqline(const char *); + void cmd_invite(const char *, const char *, const char *); } ircd_proto; diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index cadf0873d..35772eb7f 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -733,16 +733,6 @@ void unreal_cmd_chgident(const char *nick, const char *vIdent) vIdent); } -/* INVITE */ -void unreal_cmd_invite(const char *source, const char *chan, const char *nick) -{ - if (!source || !chan || !nick) { - return; - } - - send_cmd(source, "%s %s %s", send_token("INVITE", "*"), nick, chan); -} - /* PART */ void unreal_cmd_part(const char *nick, const char *chan, const char *buf) { @@ -2016,7 +2006,6 @@ void moduleAddAnopeCmds() pmodule_cmd_375(unreal_cmd_375); pmodule_cmd_376(unreal_cmd_376); pmodule_cmd_351(unreal_cmd_351); - pmodule_cmd_invite(unreal_cmd_invite); pmodule_cmd_part(unreal_cmd_part); pmodule_cmd_391(unreal_cmd_391); pmodule_cmd_250(unreal_cmd_250); diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index 07a0c3ba6..1a0a6c348 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -86,7 +86,6 @@ void unreal_cmd_372_error(const char *source); void unreal_cmd_375(const char *source); void unreal_cmd_376(const char *source); void unreal_cmd_351(const char *source); -void unreal_cmd_invite(const char *source, const char *chan, const char *nick); void unreal_cmd_part(const char *nick, const char *chan, const char *buf); void unreal_cmd_391(const char *source, const char *timestr); void unreal_cmd_250(const char *buf); |