From 7423fa9998d7e7082cac63eda18ae785091ea1b0 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 22 Feb 2024 12:00:40 +0000 Subject: Route message tags into more message functions. --- include/bots.h | 3 ++- include/modules.h | 9 ++++++--- include/protocol.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/bots.h b/include/bots.h index 87a074058..8917621d6 100644 --- a/include/bots.h +++ b/include/bots.h @@ -108,8 +108,9 @@ public: /** Called when a user messages this bot * @param u The user * @param message The users' message + * @params tags Message tags */ - virtual void OnMessage(User *u, const Anope::string &message); + virtual void OnMessage(User *u, const Anope::string &message, const Anope::map &tags); /** Link a command name to a command in services * @param cname The command name diff --git a/include/modules.h b/include/modules.h index a50ef54a9..048e28f9f 100644 --- a/include/modules.h +++ b/include/modules.h @@ -964,23 +964,26 @@ public: * @param u The user sending the PRIVMSG * @param bi The target of the PRIVMSG * @param message The message + * @param tags Message tags * @return EVENT_STOP to halt processing */ - virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); } + virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map &tags) { throw NotImplementedException(); } /** Called when we receive a NOTICE for one of our clients * @param u The user sending the NOTICE * @param bi The target of the NOTICE + * @param tags Message tags * @param message The message */ - virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); } + virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map &tags) { throw NotImplementedException(); } /** Called when we receive a PRIVMSG for a registered channel we are in * @param u The source of the message * @param c The channel * @param msg The message + * @param tags Message tags */ - virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg) { throw NotImplementedException(); } + virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map &tags) { throw NotImplementedException(); } /** Called when a message is logged * @param l The log message diff --git a/include/protocol.h b/include/protocol.h index bb0577332..08924a092 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -32,8 +32,8 @@ public: virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &); virtual void SendKickInternal(const MessageSource &, const Channel *, User *, const Anope::string &); - virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg); - virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf); + virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map &tags = {}); + virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map &tags = {}); virtual void SendQuitInternal(User *, const Anope::string &buf); virtual void SendPartInternal(User *, const Channel *chan, const Anope::string &buf); virtual void SendGlobopsInternal(const MessageSource &, const Anope::string &buf); -- cgit