Make core.get_favorites("local") ignore duplicates (#7926)

This commit is contained in:
Paul Ouellette 2019-11-08 16:18:20 -05:00 committed by SmallJoker
parent 2a74727857
commit d11bfa3ef5

@ -155,6 +155,16 @@ std::vector<ServerListSpec> deSerialize(const std::string &liststring)
server["address"] = tmp; server["address"] = tmp;
std::getline(stream, tmp); std::getline(stream, tmp);
server["port"] = tmp; server["port"] = tmp;
bool unique = true;
for (const ServerListSpec &added : serverlist) {
if (server["name"] == added["name"]
&& server["port"] == added["port"]) {
unique = false;
break;
}
}
if (!unique)
continue;
std::getline(stream, tmp); std::getline(stream, tmp);
server["description"] = tmp; server["description"] = tmp;
serverlist.push_back(server); serverlist.push_back(server);