summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-02-26 15:16:01 +0000
committerSadie Powell <sadie@witchery.services>2024-02-26 15:34:17 +0000
commite341cac8d6565044f7390852afb40c5e388121df (patch)
treee80df1e9bc03fc9603f2a985a667652fd0ebf17d /src
parent83dd96b9f2ea3a10c9c55ecec42d4f7e330643fe (diff)
Implement support for the IRCv3 +draft/channel-context tag.
Closes #358.
Diffstat (limited to 'src')
-rw-r--r--src/protocol.cpp14
1 files changed, 14 insertions, 0 deletions
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.