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

master
Paul Ouellette 2019-11-08 16:18:20 -05:00 committed by SmallJoker
parent 2a74727857
commit d11bfa3ef5
1 changed files with 10 additions and 0 deletions

View File

@ -155,6 +155,16 @@ std::vector<ServerListSpec> deSerialize(const std::string &liststring)
server["address"] = tmp;
std::getline(stream, 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);
server["description"] = tmp;
serverlist.push_back(server);