1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 17:46:37 +02:00

Replace IRCDProto::CanSendTags with IsTagValid.

Not every IRC server accepts arbitrary tags so this is a better
way to handle tag filtering.
This commit is contained in:
Sadie Powell
2024-02-26 15:44:36 +00:00
parent c6cb4ba159
commit 57674f5869
3 changed files with 17 additions and 10 deletions
+10 -6
View File
@@ -126,17 +126,21 @@ bool IRCDProto::Parse(const Anope::string &buffer, Anope::map<Anope::string> &ta
bool IRCDProto::Format(Anope::string &message, const Anope::map<Anope::string> &tags, const MessageSource &source, const Anope::string &command, const std::vector<Anope::string> &params)
{
std::stringstream buffer;
if (CanSendTags && !tags.empty())
if (!tags.empty())
{
char separator = '@';
for (const auto &[tname, tvalue] : tags)
{
buffer << separator << tname;
if (!tvalue.empty())
buffer << '=' << tvalue;
separator = ';';
if (IRCD->IsTagValid(tname, tvalue))
{
buffer << separator << tname;
if (!tvalue.empty())
buffer << '=' << tvalue;
separator = ';';
}
}
buffer << ' ';
if (separator != '@')
buffer << ' ';
}
if (source.GetServer())