mirror of
https://github.com/owntracks/recorder.git
synced 2026-04-17 01:06:33 +00:00
FIX: ocat was using incorrect ghash storage
This commit is contained in:
14
storage.c
14
storage.c
@@ -92,7 +92,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;
|
||||
JsonNode *node, *last, *card, *geo;
|
||||
JsonNode *node, *last, *card;
|
||||
|
||||
snprintf(path, BUFSIZ, "%s/last/%s/%s/%s-%s.json",
|
||||
STORAGEDIR, user, device, user, device);
|
||||
@@ -120,16 +120,10 @@ void append_device_details(JsonNode *userlist, char *user, char *device)
|
||||
}
|
||||
|
||||
if ((node = json_find_member(last, "ghash")) != NULL) {
|
||||
ghash = node->string_;
|
||||
snprintf(path, BUFSIZ, "%s/ghash/%-3.3s/%s.json",
|
||||
STORAGEDIR, ghash, ghash);
|
||||
|
||||
geo = json_mkobject();
|
||||
if (json_copy_from_file(geo, path) == TRUE) {
|
||||
json_copy_to_object(last, geo, FALSE);
|
||||
} else {
|
||||
json_delete(geo);
|
||||
}
|
||||
ghash = node->string_;
|
||||
|
||||
get_geo(last, ghash);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user