Add support for converting some groups to proxies in Surge subscriptions

This commit is contained in:
Tindy X committed 2020-08-11 13:49:31 +08:00
1 parent f6bb9bd934
commit a90ceb4b8e
1 file changed
+17 -4
+17 -4
View File
@@ -1740,11 +1740,24 @@ std::string netchToSurge(std::vector<nodeInfo> &nodes, const std::string &base_c
if(!filtered_nodelist.size())
filtered_nodelist.emplace_back("DIRECT");
if(filtered_nodelist.size() == 1)
{
proxy = toLower(filtered_nodelist[0]);
bool match_flag = false;
switch(hash_(proxy))
{
case "direct"_hash:
case "reject"_hash:
case "reject-tinygif"_hash:
ini.Set("Proxy", "{NONAME}", vArray[0] + " = " + proxy);
match_flag = true;
break;
}
if(match_flag)
continue;
}
proxy = vArray[1] + ",";
/*
for(std::string &y : filtered_nodelist)
proxy += "," + y;
*/
proxy += std::accumulate(std::next(filtered_nodelist.cbegin()), filtered_nodelist.cend(), filtered_nodelist[0], [](std::string a, std::string b)
{
return std::move(a) + "," + std::move(b);