mirror of
https://github.com/owntracks/recorder.git
synced 2024-11-15 09:58:40 -07:00
ensure payload is written to REC even if not location
This commit is contained in:
parent
78ff4b41bb
commit
7fd3161c2f
@ -442,9 +442,16 @@ void on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_m
|
||||
/* Is it OwnTracks Greenwich CSV? */
|
||||
|
||||
if ((json = csv(m->payload, tid, t, &lat, &lon, &tst)) == NULL) {
|
||||
/* It's not JSON or it's not a location CSV; store it */
|
||||
if ((fp = pathn("a", "rec", username, device, "rec")) != NULL) {
|
||||
fprintf(fp, RECFORMAT, isotime(now),
|
||||
utstring_body(rest),
|
||||
bindump(m->payload, m->payloadlen));
|
||||
fclose(fp);
|
||||
}
|
||||
return;
|
||||
}
|
||||
fprintf(stderr, "+++++ %s\n", json_stringify(json, NULL));
|
||||
// fprintf(stderr, "+++++ %s\n", json_stringify(json, NULL));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user