|
|
|
@ -427,30 +427,16 @@ const IRCMessage* IRCBase::getCurrentMessageRaw() const |
|
|
|
|
return mp->currentMessage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void IRCBase::enableIRCv3Features(const std::vector<std::string>& features) |
|
|
|
|
void IRCBase::useIRCv3Features(const std::vector<std::string>& features) |
|
|
|
|
{ |
|
|
|
|
auto isFeatureSupported = [](const std::string& feature) { |
|
|
|
|
return std::find(V3Support.begin(), V3Support.end(), feature) == V3Support.end(); |
|
|
|
|
return std::find(V3Support.begin(), V3Support.end(), feature) != V3Support.end(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
auto isFeatureEnabled = [this](const std::string& feature) { |
|
|
|
|
return std::find(mp->ircv3enabled.begin(), mp->ircv3enabled.end(), feature) != mp->ircv3enabled.end(); |
|
|
|
|
}; |
|
|
|
|
mp->ircv3enabled.clear(); |
|
|
|
|
|
|
|
|
|
for (const auto& feature : features) { |
|
|
|
|
if (!isFeatureSupported(feature) || isFeatureEnabled(feature)) |
|
|
|
|
continue; |
|
|
|
|
else |
|
|
|
|
if (isFeatureSupported(feature)) |
|
|
|
|
mp->ircv3enabled.emplace_back(feature); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void IRCBase::disableIRCv3Features(const std::vector<std::string>& features) |
|
|
|
|
{ |
|
|
|
|
for (const auto& feature : features) { |
|
|
|
|
auto it = std::find(mp->ircv3enabled.begin(), mp->ircv3enabled.end(), feature); |
|
|
|
|
if (it != mp->ircv3enabled.end()) { |
|
|
|
|
mp->ircv3enabled.erase(it); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|