From e341cac8d6565044f7390852afb40c5e388121df Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 26 Feb 2024 15:16:01 +0000 Subject: Implement support for the IRCv3 +draft/channel-context tag. Closes #358. --- src/protocol.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/protocol.cpp') diff --git a/src/protocol.cpp b/src/protocol.cpp index 9856aa446..920e0662b 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -411,6 +411,20 @@ Anope::string IRCDProto::NormalizeMask(const Anope::string &mask) return Entry("", mask).GetNUHMask(); } +void IRCDProto::SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg) +{ + IRCD->SendNoticeInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), { + { "+draft/channel-context", context->name }, + }); +} + +void IRCDProto::SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg) +{ + IRCD->SendPrivmsgInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), { + { "+draft/channel-context", context->name }, + }); +} + size_t IRCDProto::GetMaxChannel() { // We can cache this as its not allowed to change on rehash. -- cgit