mirror of
https://github.com/anope/anope.git
synced 2026-06-29 10:56:38 +02:00
Added cmd_ctcp() function to IRCDProtoNew class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1263 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -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));
|
||||
|
||||
+7
-1
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
+8
-15
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user