diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 15:22:49 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 15:22:49 +0000 |
commit | b7ed70140d6e755b49cdd3c4b9d85ec6abf30cd7 (patch) | |
tree | 6b7a447842918b9fccd127b887403880d98d6b3d | |
parent | 44e1e23a738d98815911b500e275808b435fa7c6 (diff) |
Modify base protocol to send UID if UseTS6 is enabled, or use nickname else. (TODO: rename UseTS6 to UseUID, set it *in protocol modules*, not via config)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1319 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/services.h | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/include/services.h b/include/services.h index f8bb468a3..765c7eb74 100644 --- a/include/services.h +++ b/include/services.h @@ -1252,26 +1252,27 @@ class IRCDProto { } virtual void SendNotice(BotInfo *bi, const char *dest, const char *msg) { - send_cmd(source, "NOTICE %s :%s", dest, msg); + send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :%s", dest, msg); } virtual void SendPrivmsg(BotInfo *bi, const char *dest, const char *buf) { - if (!buf || !dest) return; - send_cmd(source, "PRIVMSG %s :%s", dest, buf); + send_cmd(UseTS6 ? bi->uid : bi->nick, "PRIVMSG %s :%s", dest, buf); } virtual void SendGlobalNotice(const char *source, const char *dest, const char *msg) { - send_cmd(source, "NOTICE %s%s :%s", ircd->globaltldprefix, dest, msg); + send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s%s :%s", ircd->globaltldprefix, dest, msg); } virtual void SendGlobalPrivmsg(const char *source, const char *dest, const char *msg) { - send_cmd(source, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest, msg); + send_cmd(UseTS6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest, msg); } virtual void SendBotOp(const char *, const char *) = 0; virtual void SendQuit(const char *source, const char *buf) { - if (buf) send_cmd(source, "QUIT :%s", buf); - else send_cmd(source, "QUIT"); + if (buf) + send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT :%s", buf); + else + send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT"); } virtual void SendPong(const char *servname, const char *who) { @@ -1281,19 +1282,22 @@ class IRCDProto { virtual void SendSQLineDel(const char *) = 0; virtual void SendInvite(const char *source, const char *chan, const char *nick) { - if (!source || !chan || !nick) return; - send_cmd(source, "INVITE %s %s", nick, chan); + send_cmd(UseTS6 ? bi->uid : bi->nick, "INVITE %s %s", nick, chan); } virtual void SendPart(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); + if (buf) + send_cmd(nick, "PART %s :%s", chan, buf); + else + send_cmd(nick, "PART %s", chan); } virtual void SendGlobops(const char *source, const char *buf) { - if (!buf) return; - send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); + BotInfo *bi = findbot(source) + if (bi) + send_cmd(UseTS6 ? bi->uid : bi->nick, "GLOBOPS :%s", buf); + else + send_cmd(ServerName, "GLOBOPS :%s", buf); } virtual void SendSQLine(const char *, const char *) = 0; virtual void SendSquit(const char *servname, const char *message) @@ -1330,7 +1334,7 @@ class IRCDProto { { if (!buf) return; char *s = normalizeBuffer(buf); - send_cmd(source, "NOTICE %s :\1%s\1", dest, s); + send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :\1%s\1", dest, s); free(s); } virtual void SendSVSJoin(const char *, const char *, const char *, const char *) { } @@ -1359,22 +1363,6 @@ class IRCDProto { class IRCdProtoTS6 : public IRCdProto { - virtual void SendNotice(BotInfo *bi, const char *dest, const char *msg) - { - User *u = finduser(dest); - send_cmd(UseTS6 ? bi->uid.c_str() : bi->nick, "NOTICE %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, msg); - } - - virtual void SendPrivmsg(BotInfo *bi, const char *dest, const char *buf) - { - User *u = finduser(dest); - send_cmd(UseTS6 ? bi->uid.c_str() ? bi->nick) : source, "PRIVMSG %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, buf); - } - - virtual void SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) - { - send_cmd(UseTS6 ? whosetsts->uid.c_str() : whosetsts->nick, "TOPIC %s :%s", chan, topic); - } } /*************************************************************************/ |