summaryrefslogtreecommitdiff
path: root/modules/chanserv/cs_entrymsg.cpp
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 /modules/chanserv/cs_entrymsg.cpp
parent83dd96b9f2ea3a10c9c55ecec42d4f7e330643fe (diff)
Implement support for the IRCv3 +draft/channel-context tag.
Closes #358.
Diffstat (limited to 'modules/chanserv/cs_entrymsg.cpp')
-rw-r--r--modules/chanserv/cs_entrymsg.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/chanserv/cs_entrymsg.cpp b/modules/chanserv/cs_entrymsg.cpp
index 0b5469661..c28c58bc9 100644
--- a/modules/chanserv/cs_entrymsg.cpp
+++ b/modules/chanserv/cs_entrymsg.cpp
@@ -283,10 +283,16 @@ public:
if (u && c && c->ci && u->server->IsSynced())
{
EntryMessageList *messages = c->ci->GetExt<EntryMessageList>("entrymsg");
+ if (!messages)
+ return;
- if (messages != NULL)
- for (const auto &message : *(*messages))
- u->SendMessage(c->ci->WhoSends(), "[%s] %s", c->ci->name.c_str(), message->message.c_str());
+ for (const auto &message : *(*messages))
+ {
+ if (u->ShouldPrivmsg())
+ IRCD->SendContextPrivmsg(c->ci->WhoSends(), u, c, message->message);
+ else
+ IRCD->SendContextNotice(c->ci->WhoSends(), u, c, message->message);
+ }
}
}
};