diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-22 12:00:40 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-22 13:03:53 +0000 |
commit | 7423fa9998d7e7082cac63eda18ae785091ea1b0 (patch) | |
tree | ceda569b8b0148c7cbfca25c71e7e5a0a0d45710 /src | |
parent | 7cba665270958b6e25add883df73df4976259e54 (diff) |
Route message tags into more message functions.
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 2 | ||||
-rw-r--r-- | src/messages.cpp | 8 | ||||
-rw-r--r-- | src/protocol.cpp | 8 | ||||
-rw-r--r-- | src/users.cpp | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 9036250ed..f468ff59f 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -223,7 +223,7 @@ void BotInfo::Part(Channel *c, const Anope::string &reason) FOREACH_MOD(OnPartChannel, (this, c, c->name, reason)); } -void BotInfo::OnMessage(User *u, const Anope::string &message) +void BotInfo::OnMessage(User *u, const Anope::string &message, const Anope::map<Anope::string> &tags) { if (this->commands.empty()) return; diff --git a/src/messages.cpp b/src/messages.cpp index 5e96fee0f..1d2d28a89 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -269,7 +269,7 @@ void Notice::Run(MessageSource &source, const std::vector<Anope::string> ¶ms BotInfo *bi = BotInfo::Find(params[0]); if (!bi) return; - FOREACH_MOD(OnBotNotice, (u, bi, message)); + FOREACH_MOD(OnBotNotice, (u, bi, message, tags)); } } @@ -312,7 +312,7 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m Channel *c = Channel::Find(receiver); if (c) { - FOREACH_MOD(OnPrivmsg, (u, c, message)); + FOREACH_MOD(OnPrivmsg, (u, c, message, tags)); } } else @@ -362,11 +362,11 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m } EventReturn MOD_RESULT; - FOREACH_RESULT(OnBotPrivmsg, MOD_RESULT, (u, bi, message)); + FOREACH_RESULT(OnBotPrivmsg, MOD_RESULT, (u, bi, message, tags)); if (MOD_RESULT == EVENT_STOP) return; - bi->OnMessage(u, message); + bi->OnMessage(u, message, tags); } } diff --git a/src/protocol.cpp b/src/protocol.cpp index cfa03d3d8..bf7d1bc28 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -117,14 +117,14 @@ void IRCDProto::SendKickInternal(const MessageSource &source, const Channel *c, Uplink::Send(source, "KICK", c->name, u->GetUID()); } -void IRCDProto::SendNoticeInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg) +void IRCDProto::SendNoticeInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags) { - Uplink::Send(source, "NOTICE", dest, msg); + Uplink::Send(tags, source, "NOTICE", dest, msg); } -void IRCDProto::SendPrivmsgInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &buf) +void IRCDProto::SendPrivmsgInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags) { - Uplink::Send(source, "PRIVMSG", dest, buf); + Uplink::Send(tags, source, "PRIVMSG", dest, msg); } void IRCDProto::SendQuitInternal(User *u, const Anope::string &buf) diff --git a/src/users.cpp b/src/users.cpp index fc509ee0a..452d84706 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -346,9 +346,9 @@ void User::SendMessage(BotInfo *source, const Anope::string &msg) for (Anope::string tok; sep.GetToken(tok);) { if (send_privmsg) - IRCD->SendPrivmsg(source, this->GetUID(), "%s", tok.c_str()); + IRCD->SendPrivmsgInternal(source, this->GetUID(), tok); else - IRCD->SendNotice(source, this->GetUID(), "%s", tok.c_str()); + IRCD->SendNoticeInternal(source, this->GetUID(), tok); } } |