1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 16:36:39 +02:00

Added cmd_notice() function to IRCDProtoNew class. (Replaces cmd_notice2)

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1229 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:11 +00:00
parent efb458a927
commit 6fa5553b4b
15 changed files with 25 additions and 69 deletions
+1 -2
View File
@@ -611,7 +611,6 @@ E void pmodule_cmd_372(void (*func) (const char *source, const char *msg));
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_notice2(void (*func) (const char *source, const char *dest, const char *msg));
E void pmodule_cmd_serv_notice(void (*func) (const char *source, const char *dest, const char *msg));
E void pmodule_cmd_serv_privmsg(void (*func) (const char *source, const char *dest, const char *msg));
E void pmodule_cmd_bot_chan_mode(void (*func) (const char *nick, const char *chan));
@@ -1221,7 +1220,7 @@ E void anope_cmd_bot_nick(const char *nick, const char *user,const char *host,co
E void anope_cmd_guest_nick(const char *nick, const char *user,const char *host,const char *real,const char *modes); /* NICK */
E void anope_cmd_message(const char *source, const char *dest, const char *fmt, ...); /* NOTICE */
E void anope_cmd_notice_ops(const char *source, const char *dest, const char *fmt, ...); /* NOTICE */
E void anope_cmd_notice2(const char *source, const char *dest, const char *msg); /* NOTICE */
E void anope_cmd_notice(const char *source, const char *dest, const char *msg); /* NOTICE */
E void anope_cmd_serv_notice(const char *source, const char *dest, const char *msg); /* NOTICE */
E void anope_cmd_part(const char *nick, const char *chan, const char *fmt, ...); /* PART */
E void anope_cmd_pass(const char *pass); /* PASS */
+5 -2
View File
@@ -1059,7 +1059,6 @@ typedef struct ircd_proto_ {
void (*ircd_cmd_372_error)(const char *source);
void (*ircd_cmd_375)(const char *source);
void (*ircd_cmd_376)(const char *source);
void (*ircd_cmd_notice2)(const char *source, const char *dest, const char *msg);
void (*ircd_cmd_serv_notice)(const char *source, const char *dest, const char *msg);
void (*ircd_cmd_serv_privmsg)(const char *source, const char *dest, const char *msg);
void (*ircd_cmd_bot_chan_mode)(const char *nick, const char *chan);
@@ -1309,7 +1308,11 @@ class IRCDProtoNew {
{
if (!buf || !dest) return;
if (NSDefFlags & NI_MSG) cmd_privmsg(source, dest, buf);
else send_cmd(source, "NOTICE %s :%s", dest, buf);
else cmd_notice(source, dest, buf);
}
virtual void cmd_notice(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "NOTICE %s :%s", dest, msg);
}
virtual void cmd_privmsg(const char *source, const char *dest, const char *buf)
{
+2 -9
View File
@@ -50,7 +50,6 @@ void initIrcdProto()
ircdproto.ircd_cmd_372_error = NULL;
ircdproto.ircd_cmd_375 = NULL;
ircdproto.ircd_cmd_376 = NULL;
ircdproto.ircd_cmd_notice2 = NULL;
ircdproto.ircd_cmd_serv_notice = NULL;
ircdproto.ircd_cmd_serv_privmsg = NULL;
ircdproto.ircd_cmd_bot_chan_mode = NULL;
@@ -245,9 +244,9 @@ void anope_cmd_message(const char *source, const char *dest, const char *fmt, ..
ircdprotonew->cmd_message(source, dest, buf);
}
void anope_cmd_notice2(const char *source, const char *dest, const char *msg)
void anope_cmd_notice(const char *source, const char *dest, const char *msg)
{
ircdproto.ircd_cmd_notice2(source, dest, msg);
ircdprotonew->cmd_notice(source, dest, msg);
}
void anope_cmd_action(const char *source, const char *dest, const char *fmt, ...)
@@ -662,12 +661,6 @@ void pmodule_cmd_376(void (*func) (const char *source))
ircdproto.ircd_cmd_376 = func;
}
void
pmodule_cmd_notice2(void (*func) (const char *source, const char *dest, const char *msg))
{
ircdproto.ircd_cmd_notice2 = func;
}
void
pmodule_cmd_serv_notice(void (*func) (const char *source, const char *dest, const char *msg))
{
-6
View File
@@ -1027,11 +1027,6 @@ void BahamutIRCdProto::cmd_notice_ops(const char *source, const char *dest, cons
send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
}
void bahamut_cmd_notice2(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "NOTICE %s :%s", dest, msg);
}
void bahamut_cmd_serv_notice(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "NOTICE $%s :%s", dest, msg);
@@ -1502,7 +1497,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_372_error(bahamut_cmd_372_error);
pmodule_cmd_375(bahamut_cmd_375);
pmodule_cmd_376(bahamut_cmd_376);
pmodule_cmd_notice2(bahamut_cmd_notice2);
pmodule_cmd_serv_notice(bahamut_cmd_serv_notice);
pmodule_cmd_serv_privmsg(bahamut_cmd_serv_privmsg);
pmodule_cmd_bot_chan_mode(bahamut_cmd_bot_chan_mode);
-1
View File
@@ -63,7 +63,6 @@ void bahamut_cmd_372(const char *source, const char *msg);
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_notice2(const char *source, const char *dest, const char *msg);
void bahamut_cmd_serv_notice(const char *source, const char *dest, const char *msg);
void bahamut_cmd_serv_privmsg(const char *source, const char *dest, const char *msg);
void bahamut_cmd_bot_chan_mode(const char *nick, const char *chan);
+4 -13
View File
@@ -455,22 +455,14 @@ void CharybdisProto::cmd_message(const char *source, const char *dest, const cha
{
if (!buf) return;
if (NSDefFlags & NI_MSG) cmd_privmsg(source, dest, buf);
else {
Uid *ud = find_uid(source);
User *u = finduser(dest);
send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "NOTICE %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, buf);
}
else cmd_notice(source, dest, buf);
}
void charybdis_cmd_notice2(const char *source, const char *dest, const char *msg)
{
Uid *ud;
User *u;
ud = find_uid(source);
u = finduser(dest);
send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "NOTICE %s :%s",
(UseTS6 ? (u ? u->uid : dest) : dest), msg);
Uid *ud = find_uid(source);
User *u = finduser(dest);
send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "NOTICE %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, msg);
}
void CharybdisProto::cmd_privmsg(const char *source, const char *dest, const char *buf)
@@ -1759,7 +1751,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_372_error(charybdis_cmd_372_error);
pmodule_cmd_375(charybdis_cmd_375);
pmodule_cmd_376(charybdis_cmd_376);
pmodule_cmd_notice2(charybdis_cmd_notice2);
pmodule_cmd_serv_notice(charybdis_cmd_serv_notice);
pmodule_cmd_serv_privmsg(charybdis_cmd_serv_privmsg);
pmodule_cmd_bot_chan_mode(charybdis_cmd_bot_chan_mode);
+1 -1
View File
@@ -51,7 +51,6 @@ void charybdis_cmd_372(const char *source, const char *msg);
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_notice2(const char *source, const char *dest, const char *msg);
void charybdis_cmd_serv_notice(const char *source, const char *dest, const char *msg);
void charybdis_cmd_serv_privmsg(const char *source, const char *dest, const char *msg);
void charybdis_cmd_bot_chan_mode(const char *nick, const char *chan);
@@ -114,5 +113,6 @@ class CharybdisProto : public IRCDProtoNew {
void cmd_kick(const char *, const char *, const char *, const char *);
void cmd_notice_ops(const char *, const char *, const char *);
void cmd_message(const char *, const char *, const char *);
void cmd_notice(const char *, const char *, const char *);
void cmd_privmsg(const char *, const char *, const char *);
} ircd_proto;
-6
View File
@@ -780,11 +780,6 @@ void InspIRCdProto::cmd_notice_ops(const char *source, const char *dest, const c
}
void inspircd_cmd_notice2(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "NOTICE %s :%s", dest, msg);
}
void inspircd_cmd_serv_notice(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "NOTICE $%s :%s", dest, msg);
@@ -1750,7 +1745,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_372_error(inspircd_cmd_372_error);
pmodule_cmd_375(inspircd_cmd_375);
pmodule_cmd_376(inspircd_cmd_376);
pmodule_cmd_notice2(inspircd_cmd_notice2);
pmodule_cmd_serv_notice(inspircd_cmd_serv_notice);
pmodule_cmd_serv_privmsg(inspircd_cmd_serv_privmsg);
pmodule_cmd_bot_chan_mode(inspircd_cmd_bot_chan_mode);
-1
View File
@@ -56,7 +56,6 @@ void inspircd_cmd_372(const char *source, const char *msg);
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_notice2(const char *source, const char *dest, const char *msg);
void inspircd_cmd_serv_notice(const char *source, const char *dest, const char *msg);
void inspircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg);
void inspircd_cmd_bot_chan_mode(const char *nick, const char *chan);
+5 -14
View File
@@ -444,22 +444,14 @@ void RatboxProto::cmd_message(const char *source, const char *dest, const char *
{
if (!buf) return;
if (NSDefFlags & NI_MSG) cmd_privmsg(source, dest, buf);
else {
Uid *ud = find_uid(source);
User *u = finduser(dest);
send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "NOTICE %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, buf);
}
else cmd_notice(source, dest, buf);
}
void ratbox_cmd_notice2(const char *source, const char *dest, const char *msg)
void RatboxProto::cmd_notice(const char *source, const char *dest, const char *msg)
{
Uid *ud;
User *u;
ud = find_uid(source);
u = finduser(dest);
send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "NOTICE %s :%s",
(UseTS6 ? (u ? u->uid : dest) : dest), msg);
Uid *ud = find_uid(source);
User *u = finduser(dest);
send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "NOTICE %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, msg);
}
void RatboxProto::cmd_privmsg(const char *source, const char *dest, const char *buf)
@@ -1653,7 +1645,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_372_error(ratbox_cmd_372_error);
pmodule_cmd_375(ratbox_cmd_375);
pmodule_cmd_376(ratbox_cmd_376);
pmodule_cmd_notice2(ratbox_cmd_notice2);
pmodule_cmd_serv_notice(ratbox_cmd_serv_notice);
pmodule_cmd_serv_privmsg(ratbox_cmd_serv_privmsg);
pmodule_cmd_bot_chan_mode(ratbox_cmd_bot_chan_mode);
+1 -1
View File
@@ -50,7 +50,6 @@ void ratbox_cmd_372(const char *source, const char *msg);
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_notice2(const char *source, const char *dest, const char *msg);
void ratbox_cmd_serv_notice(const char *source, const char *dest, const char *msg);
void ratbox_cmd_serv_privmsg(const char *source, const char *dest, const char *msg);
void ratbox_cmd_bot_chan_mode(const char *nick, const char *chan);
@@ -112,5 +111,6 @@ class RatboxProto : public IRCDProtoNew {
void cmd_kick(const char *, const char *, const char *, const char *);
void cmd_notice_ops(const char *, const char *, const char *);
void cmd_message(const char *, const char *, const char *);
void cmd_notice(const char *, const char *, const char *);
void cmd_privmsg(const char *, const char *, const char *);
} ircd_proto;
-6
View File
@@ -629,11 +629,6 @@ void UnrealIRCdProto::cmd_notice_ops(const char *source, const char *dest, const
}
void unreal_cmd_notice2(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "%s %s :%s", send_token("NOTICE", "B"), dest, msg);
}
void unreal_cmd_serv_notice(const char *source, const char *dest, const char *msg)
{
send_cmd(source, "%s $%s :%s", send_token("NOTICE", "B"), dest, msg);
@@ -2050,7 +2045,6 @@ void moduleAddAnopeCmds()
pmodule_cmd_372_error(unreal_cmd_372_error);
pmodule_cmd_375(unreal_cmd_375);
pmodule_cmd_376(unreal_cmd_376);
pmodule_cmd_notice2(unreal_cmd_notice2);
pmodule_cmd_serv_notice(unreal_cmd_serv_notice);
pmodule_cmd_serv_privmsg(unreal_cmd_serv_privmsg);
pmodule_cmd_bot_chan_mode(unreal_cmd_bot_chan_mode);
-1
View File
@@ -85,7 +85,6 @@ void unreal_cmd_372(const char *source, const char *msg);
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_notice2(const char *source, const char *dest, const char *msg);
void unreal_cmd_serv_notice(const char *source, const char *dest, const char *msg);
void unreal_cmd_serv_privmsg(const char *source, const char *dest, const char *msg);
void unreal_cmd_bot_chan_mode(const char *nick, const char *chan);
+5 -5
View File
@@ -123,9 +123,9 @@ void notice_list(char *source, char *dest, char **text)
* with a single space.
*/
if (**text) {
anope_cmd_notice2(source, dest, *text);
anope_cmd_notice(source, dest, *text);
} else {
anope_cmd_notice2(source, dest, " ");
anope_cmd_notice(source, dest, " ");
}
text++;
}
@@ -174,7 +174,7 @@ void notice_lang(const char *source, User * dest, int message, ...)
&& (dest->na->nc->flags & NI_MSG)))) {
anope_cmd_privmsg(source, dest->nick, *t ? t : " ");
} else {
anope_cmd_notice2(source, dest->nick, *t ? t : " ");
anope_cmd_notice(source, dest->nick, *t ? t : " ");
}
}
va_end(args);
@@ -230,7 +230,7 @@ void notice_help(const char *source, User * dest, int message, ...)
&& (dest->na->nc->flags & NI_MSG)))) {
anope_cmd_privmsg(source, dest->nick, *outbuf ? outbuf : " ");
} else {
anope_cmd_notice2(source, dest->nick, *outbuf ? outbuf : " ");
anope_cmd_notice(source, dest->nick, *outbuf ? outbuf : " ");
}
}
va_end(args);
@@ -259,7 +259,7 @@ void notice(char *source, const char *dest, const char *fmt, ...)
if (NSDefFlags & NI_MSG) {
anope_cmd_privmsg(source, dest, buf);
} else {
anope_cmd_notice2(source, dest, buf);
anope_cmd_notice(source, dest, buf);
}
va_end(args);
}
+1 -1
View File
@@ -291,7 +291,7 @@ void User::SendMessage(const char *source, const std::string &msg)
}
else
{
anope_cmd_notice2(source, this->nick, msg.c_str());
anope_cmd_notice(source, this->nick, msg.c_str());
}
}