From d00026ac063e960728c5147634ff3591828efced Mon Sep 17 00:00:00 2001 From: default Date: Sat, 3 Dec 2022 17:58:49 +0100 Subject: Upgraded local/ to public/. --- data.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'data.c') diff --git a/data.c b/data.c index 12ba447..f3a1ce8 100644 --- a/data.c +++ b/data.c @@ -15,7 +15,7 @@ #include #include -double db_layout = 2.5; +double db_layout = 2.6; int db_upgrade(d_char **error); @@ -500,9 +500,13 @@ int _object_add(const char *id, d_char *obj, int ow) xs *c_idx = _object_fn(in_reply_to); c_idx = xs_replace_i(c_idx, ".json", "_c.idx"); - index_add(c_idx, id); - srv_debug(0, xs_fmt("object_add added child %s to %s", id, c_idx)); + if (!index_in(c_idx, id)) { + index_add(c_idx, id); + srv_debug(0, xs_fmt("object_add added child %s to %s", id, c_idx)); + } + else + srv_debug(0, xs_fmt("object_add %s child already in %s", id, c_idx)); /* create a one-element index with the parent */ xs *p_idx = xs_replace(fn, ".json", "_p.idx"); -- cgit v1.2.3