summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ircd.c26
-rw-r--r--src/protocol/bahamut.c15
-rw-r--r--src/protocol/bahamut.h1
-rw-r--r--src/protocol/charybdis.c15
-rw-r--r--src/protocol/charybdis.h2
-rw-r--r--src/protocol/inspircd11.c15
-rwxr-xr-xsrc/protocol/inspircd11.h1
-rw-r--r--src/protocol/ratbox.c15
-rw-r--r--src/protocol/ratbox.h2
-rw-r--r--src/protocol/unreal32.c15
-rw-r--r--src/protocol/unreal32.h1
11 files changed, 19 insertions, 89 deletions
diff --git a/src/ircd.c b/src/ircd.c
index 348d1ba61..c2ba87303 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_part = NULL;
ircdproto.ircd_cmd_391 = NULL;
ircdproto.ircd_cmd_250 = NULL;
ircdproto.ircd_cmd_307 = NULL;
@@ -322,17 +321,15 @@ void anope_cmd_invite(const char *source, const char *chan, const char *nick)
void anope_cmd_part(const char *nick, const char *chan, const char *fmt, ...)
{
- if (fmt) {
- va_list args;
- char buf[BUFSIZE];
- *buf = '\0';
- va_start(args, fmt);
- vsnprintf(buf, BUFSIZE - 1, fmt, args);
- va_end(args);
- ircdproto.ircd_cmd_part(nick, chan, buf);
- } else {
- ircdproto.ircd_cmd_part(nick, chan, NULL);
- }
+ if (fmt) {
+ va_list args;
+ char buf[BUFSIZE] = "";
+ va_start(args, fmt);
+ vsnprintf(buf, BUFSIZE - 1, fmt, args);
+ va_end(args);
+ ircdprotonew->cmd_part(nick, chan, buf);
+ }
+ else ircdprotonew->cmd_part(nick, chan, NULL);
}
void anope_cmd_391(const char *source, const char *timestr)
@@ -657,11 +654,6 @@ void pmodule_cmd_351(void (*func) (const char *source))
ircdproto.ircd_cmd_351 = func;
}
-void pmodule_cmd_part(void (*func) (const char *nick, const char *chan, const char *buf))
-{
- ircdproto.ircd_cmd_part = func;
-}
-
void pmodule_cmd_391(void (*func) (const char *source, const char *timestr))
{
ircdproto.ircd_cmd_391 = func;
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index 713e59d98..b1fdedf86 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -744,20 +744,6 @@ void BahamutIRCdProto::cmd_remove_akill(const char *user, const char *host)
send_cmd(NULL, "RAKILL %s %s", host, user);
}
-/* PART */
-void bahamut_cmd_part(const char *nick, const char *chan, const char *buf)
-{
- if (!nick || !chan) {
- return;
- }
-
- if (buf) {
- send_cmd(nick, "PART %s :%s", chan, buf);
- } else {
- send_cmd(nick, "PART %s", chan);
- }
-}
-
/* TOPIC */
void BahamutIRCdProto::cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when)
{
@@ -1463,7 +1449,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_375(bahamut_cmd_375);
pmodule_cmd_376(bahamut_cmd_376);
pmodule_cmd_351(bahamut_cmd_351);
- pmodule_cmd_part(bahamut_cmd_part);
pmodule_cmd_391(bahamut_cmd_391);
pmodule_cmd_250(bahamut_cmd_250);
pmodule_cmd_307(bahamut_cmd_307);
diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h
index a2ea3a88d..6eaa5d8eb 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_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);
void bahamut_cmd_307(const char *buf);
diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c
index bc81e1456..0e5c4c6ae 100644
--- a/src/protocol/charybdis.c
+++ b/src/protocol/charybdis.c
@@ -950,17 +950,11 @@ void CharybdisProto::cmd_bot_nick(const char *nick, const char *user, const char
charybdis_cmd_sqline(nick, "Reserved for services");
}
-void charybdis_cmd_part(const char *nick, const char *chan, const char *buf)
+void CharybdisProto::cmd_part(const char *nick, const char *chan, const char *buf)
{
- Uid *ud;
-
- ud = find_uid(nick);
-
- if (buf) {
- send_cmd((UseTS6 ? ud->uid : nick), "PART %s :%s", chan, buf);
- } else {
- send_cmd((UseTS6 ? ud->uid : nick), "PART %s", chan);
- }
+ Uid *ud = find_uid(nick);
+ if (buf) send_cmd(UseTS6 ? ud->uid : nick, "PART %s :%s", chan, buf);
+ else send_cmd(UseTS6 ? ud->uid : nick, "PART %s", chan);
}
int anope_event_ping(const char *source, int ac, const char **av)
@@ -1715,7 +1709,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_375(charybdis_cmd_375);
pmodule_cmd_376(charybdis_cmd_376);
pmodule_cmd_351(charybdis_cmd_351);
- pmodule_cmd_part(charybdis_cmd_part);
pmodule_cmd_391(charybdis_cmd_391);
pmodule_cmd_250(charybdis_cmd_250);
pmodule_cmd_307(charybdis_cmd_307);
diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h
index 60f5e3676..752f1281b 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_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);
void charybdis_cmd_307(const char *buf);
@@ -113,4 +112,5 @@ class CharybdisProto : public IRCDProtoNew {
void cmd_join(const char *, const char *, time_t);
void cmd_unsqline(const char *);
void cmd_invite(const char *, const char *, const char *);
+ void cmd_part(const char *, const char *, const char *);
} ircd_proto;
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index 93d245cdb..e3c3ab7dd 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -838,20 +838,6 @@ void inspircd_cmd_chgident(const char *nick, const char *vIdent)
}
}
-/* PART */
-void inspircd_cmd_part(const char *nick, const char *chan, const char *buf)
-{
- if (!nick || !chan) {
- return;
- }
-
- if (buf) {
- send_cmd(nick, "PART %s :%s", chan, buf);
- } else {
- send_cmd(nick, "PART %s :Leaving", chan);
- }
-}
-
/* 391 */
void inspircd_cmd_391(const char *source, const char *timestr)
{
@@ -1707,7 +1693,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_375(inspircd_cmd_375);
pmodule_cmd_376(inspircd_cmd_376);
pmodule_cmd_351(inspircd_cmd_351);
- pmodule_cmd_part(inspircd_cmd_part);
pmodule_cmd_391(inspircd_cmd_391);
pmodule_cmd_250(inspircd_cmd_250);
pmodule_cmd_307(inspircd_cmd_307);
diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h
index 39549f9db..11a9efabd 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_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);
void inspircd_cmd_307(const char *buf);
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index 4b11f6bd4..57ede49e3 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -890,17 +890,11 @@ void RatboxProto::cmd_bot_nick(const char *nick, const char *user, const char *h
ratbox_cmd_sqline(nick, "Reserved for services");
}
-void ratbox_cmd_part(const char *nick, const char *chan, const char *buf)
+void RatboxProto::cmd_part(const char *nick, const char *chan, const char *buf)
{
- Uid *ud;
-
- ud = find_uid(nick);
-
- if (buf) {
- send_cmd((UseTS6 ? ud->uid : nick), "PART %s :%s", chan, buf);
- } else {
- send_cmd((UseTS6 ? ud->uid : nick), "PART %s", chan);
- }
+ Uid *ud = find_uid(nick);
+ if (buf) send_cmd(UseTS6 ? ud->uid : nick, "PART %s :%s", chan, buf);
+ else send_cmd(UseTS6 ? ud->uid : nick, "PART %s", chan);
}
int anope_event_ping(const char *source, int ac, const char **av)
@@ -1609,7 +1603,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_375(ratbox_cmd_375);
pmodule_cmd_376(ratbox_cmd_376);
pmodule_cmd_351(ratbox_cmd_351);
- pmodule_cmd_part(ratbox_cmd_part);
pmodule_cmd_391(ratbox_cmd_391);
pmodule_cmd_250(ratbox_cmd_250);
pmodule_cmd_307(ratbox_cmd_307);
diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h
index bbf6c972e..698b3a7dc 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_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);
void ratbox_cmd_307(const char *buf);
@@ -111,4 +110,5 @@ class RatboxProto : public IRCDProtoNew {
void cmd_join(const char *, const char *, time_t);
void cmd_unsqline(const char *);
void cmd_invite(const char *, const char *, const char *);
+ void cmd_part(const char *, const char *, const char *);
} ircd_proto;
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index 35772eb7f..f8eb5396a 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -733,20 +733,6 @@ void unreal_cmd_chgident(const char *nick, const char *vIdent)
vIdent);
}
-/* PART */
-void unreal_cmd_part(const char *nick, const char *chan, const char *buf)
-{
- if (!nick || !chan) {
- return;
- }
-
- if (buf) {
- send_cmd(nick, "%s %s :%s", send_token("PART", "D"), chan, buf);
- } else {
- send_cmd(nick, "%s %s", send_token("PART", "D"), chan);
- }
-}
-
/* 391 RPL_TIME ":%s 391 %s %s :%s" */
void unreal_cmd_391(const char *source, const char *timestr)
{
@@ -2006,7 +1992,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_375(unreal_cmd_375);
pmodule_cmd_376(unreal_cmd_376);
pmodule_cmd_351(unreal_cmd_351);
- pmodule_cmd_part(unreal_cmd_part);
pmodule_cmd_391(unreal_cmd_391);
pmodule_cmd_250(unreal_cmd_250);
pmodule_cmd_307(unreal_cmd_307);
diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h
index 1a0a6c348..4abe97fde 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_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);
void unreal_cmd_307(const char *buf);