mirror of
https://github.com/anope/anope.git
synced 2026-07-07 03:43:13 +02:00
Allow protocol modules to apply tags to sent messages.
This is useful because for some IRCv3 specifications we need to apply tags to all messages and its annoying to have to do this inline when sending each message.
This commit is contained in:
@@ -100,6 +100,13 @@ void Anope::ProcessInternal(MessageSource &src, const Anope::string &command, co
|
||||
}
|
||||
}
|
||||
|
||||
void IRCDProto::PopulateTags(Anope::map<Anope::string> &tags, const MessageSource &source, const Anope::string &command, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
auto it = tags.find("time"); // https://ircv3.net/specs/extensions/server-time
|
||||
if (it == tags.end())
|
||||
tags["time"] = Anope::FormatISO8601(Anope::CurTime, Anope::CurTimeNs / 1'000'000);
|
||||
}
|
||||
|
||||
bool IRCDProto::Parse(const Anope::string &buffer, Anope::map<Anope::string> &tags, Anope::string &source, Anope::string &command, std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
MessageTokenizer tokens(buffer);
|
||||
|
||||
Reference in New Issue
Block a user