diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <sys/file.h> | 15 | #include <sys/file.h> |
| 16 | #include <fcntl.h> | 16 | #include <fcntl.h> |
| 17 | 17 | ||
| 18 | double db_layout = 2.5; | 18 | double db_layout = 2.6; |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | int db_upgrade(d_char **error); | 21 | int db_upgrade(d_char **error); |
| @@ -500,9 +500,13 @@ int _object_add(const char *id, d_char *obj, int ow) | |||
| 500 | xs *c_idx = _object_fn(in_reply_to); | 500 | xs *c_idx = _object_fn(in_reply_to); |
| 501 | 501 | ||
| 502 | c_idx = xs_replace_i(c_idx, ".json", "_c.idx"); | 502 | c_idx = xs_replace_i(c_idx, ".json", "_c.idx"); |
| 503 | index_add(c_idx, id); | ||
| 504 | 503 | ||
| 505 | srv_debug(0, xs_fmt("object_add added child %s to %s", id, c_idx)); | 504 | if (!index_in(c_idx, id)) { |
| 505 | index_add(c_idx, id); | ||
| 506 | srv_debug(0, xs_fmt("object_add added child %s to %s", id, c_idx)); | ||
| 507 | } | ||
| 508 | else | ||
| 509 | srv_debug(0, xs_fmt("object_add %s child already in %s", id, c_idx)); | ||
| 506 | 510 | ||
| 507 | /* create a one-element index with the parent */ | 511 | /* create a one-element index with the parent */ |
| 508 | xs *p_idx = xs_replace(fn, ".json", "_p.idx"); | 512 | xs *p_idx = xs_replace(fn, ".json", "_p.idx"); |