aboutsummaryrefslogtreecommitdiff
path: root/src/serverlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serverlist.cpp')
-rw-r--r--src/serverlist.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/serverlist.cpp b/src/serverlist.cpp
index 7d3ab4bbb..18264e933 100644
--- a/src/serverlist.cpp
+++ b/src/serverlist.cpp
@@ -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);