renamed ClientInfo::clientId to ClientInfo::id

This commit is contained in:
badaix 2016-12-03 14:12:56 +01:00
parent a860f60f0c
commit 07f395395b
2 changed files with 7 additions and 7 deletions

View file

@ -56,7 +56,7 @@ Config::Config()
{ {
GroupPtr group = make_shared<Group>(); GroupPtr group = make_shared<Group>();
group->fromJson(*it); group->fromJson(*it);
// if (client->clientId.empty() || getClientInfo(client->clientId)) // if (client->id.empty() || getClientInfo(client->id))
// continue; // continue;
groups.push_back(group); groups.push_back(group);
} }
@ -95,7 +95,7 @@ ClientInfoPtr Config::getClientInfo(const std::string& clientId) const
for (auto client: clients) for (auto client: clients)
{ {
if (client->clientId == clientId) if (client->id == clientId)
return client; return client;
} }
@ -122,7 +122,7 @@ GroupPtr Config::getGroup(ClientInfoPtr client)
{ {
for (auto c: group->clients) for (auto c: group->clients)
{ {
if (c->clientId == client->clientId) if (c->id == client->id)
return group; return group;
} }
} }

View file

@ -216,7 +216,7 @@ struct Snapserver : public Snapcast
struct ClientInfo struct ClientInfo
{ {
ClientInfo(const std::string& _clientId = "") : clientId(_clientId), connected(false) ClientInfo(const std::string& _clientId = "") : id(_clientId), connected(false)
{ {
lastSeen.tv_sec = 0; lastSeen.tv_sec = 0;
lastSeen.tv_usec = 0; lastSeen.tv_usec = 0;
@ -225,7 +225,7 @@ struct ClientInfo
void fromJson(const json& j) void fromJson(const json& j)
{ {
host.fromJson(j["host"]); host.fromJson(j["host"]);
clientId = jGet<std::string>(j, "id", host.mac); id = jGet<std::string>(j, "id", host.mac);
snapclient.fromJson(j["snapclient"]); snapclient.fromJson(j["snapclient"]);
config.fromJson(j["config"]); config.fromJson(j["config"]);
lastSeen.tv_sec = jGet<int32_t>(j["lastSeen"], "sec", 0); lastSeen.tv_sec = jGet<int32_t>(j["lastSeen"], "sec", 0);
@ -236,7 +236,7 @@ struct ClientInfo
json toJson() json toJson()
{ {
json j; json j;
j["id"] = clientId; j["id"] = id;
j["host"] = host.toJson(); j["host"] = host.toJson();
j["snapclient"] = snapclient.toJson(); j["snapclient"] = snapclient.toJson();
j["config"] = config.toJson(); j["config"] = config.toJson();
@ -246,7 +246,7 @@ struct ClientInfo
return j; return j;
} }
std::string clientId; std::string id;
Host host; Host host;
Snapclient snapclient; Snapclient snapclient;
ClientConfig config; ClientConfig config;