FIX: if storage doesn't have a card for LAST, don't complain & no fake things

This commit is contained in:
Jan-Piet Mens
2015-09-01 16:46:48 +02:00
parent d1548b0edf
commit 19499bf2f6
+5 -11
View File
@@ -91,7 +91,7 @@ static int user_device_list(char *name, int level, JsonNode *obj)
void append_device_details(JsonNode *userlist, char *user, char *device)
{
char path[BUFSIZ], *ghash;
char path[BUFSIZ];
JsonNode *node, *last, *card;
snprintf(path, BUFSIZ, "%s/last/%s/%s/%s-%s.json",
@@ -111,20 +111,14 @@ void append_device_details(JsonNode *userlist, char *user, char *device)
if (json_copy_from_file(card, path) == TRUE) {
json_copy_to_object(last, card, FALSE);
} else {
/* No CARD? Add pseudo data */
json_append_member(last, "name", json_mknull());
json_append_member(last, "face", json_mknull());
json_delete(card);
}
if ((node = json_find_member(last, "ghash")) != NULL) {
ghash = node->string_;
get_geo(last, ghash);
if (node->tag == JSON_STRING) {
get_geo(last, node->string_);
}
}
}
/*