1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 01:23:12 +02:00

Add an IRCv3 time tag to entry messages.

This commit is contained in:
Sadie Powell
2025-10-18 00:38:25 +01:00
parent 84dc0f3cc8
commit b9554f8539
5 changed files with 42 additions and 21 deletions
+11 -2
View File
@@ -296,12 +296,21 @@ public:
if (!messages)
return;
const auto timestamp = Config->GetModule(this).Get<bool>("timestamp", "yes");
for (const auto &message : *(*messages))
{
Anope::map<Anope::string> tags;
if (timestamp)
{
char timebuf[32];
strftime(timebuf, sizeof(timebuf), "%Y-%m-%dT%H:%M:%S.000Z", gmtime(&message->when));
tags["time"] = timebuf;
}
if (u->ShouldPrivmsg())
IRCD->SendContextPrivmsg(c->ci->WhoSends(), u, c, message->message);
IRCD->SendContextPrivmsg(c->ci->WhoSends(), u, c, message->message, tags);
else
IRCD->SendContextNotice(c->ci->WhoSends(), u, c, message->message);
IRCD->SendContextNotice(c->ci->WhoSends(), u, c, message->message, tags);
}
}
}