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:
+10
-6
@@ -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> ¶ms)
|
||||
{
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user