diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -196,7 +196,7 @@ double mtime(char *fn) | |||
| 196 | int index_add_md5(const char *fn, const char *md5) | 196 | int index_add_md5(const char *fn, const char *md5) |
| 197 | /* adds an md5 to an index */ | 197 | /* adds an md5 to an index */ |
| 198 | { | 198 | { |
| 199 | int status = 200; | 199 | int status = 201; /* Created */ |
| 200 | FILE *f; | 200 | FILE *f; |
| 201 | 201 | ||
| 202 | if ((f = fopen(fn, "a")) != NULL) { | 202 | if ((f = fopen(fn, "a")) != NULL) { |
| @@ -498,13 +498,17 @@ d_char *object_children(const char *id) | |||
| 498 | int object_admire(const char *id, const char *actor, int like) | 498 | int object_admire(const char *id, const char *actor, int like) |
| 499 | /* actor likes or announces this object */ | 499 | /* actor likes or announces this object */ |
| 500 | { | 500 | { |
| 501 | xs *fn = _object_fn(id); | 501 | int status = 200; |
| 502 | xs *fn = _object_fn(id); | ||
| 502 | 503 | ||
| 503 | fn = xs_replace_i(fn, ".json", like ? "_l.idx" : "_a.idx"); | 504 | fn = xs_replace_i(fn, ".json", like ? "_l.idx" : "_a.idx"); |
| 504 | 505 | ||
| 505 | srv_debug(0, xs_fmt("object_admire (%s) %s %s", like ? "Like" : "Announce", actor, fn)); | 506 | srv_debug(0, xs_fmt("object_admire (%s) %s %s", like ? "Like" : "Announce", actor, fn)); |
| 506 | 507 | ||
| 507 | return index_add(fn, actor); | 508 | if (!index_in(fn, actor)) |
| 509 | status = index_add(fn, actor); | ||
| 510 | |||
| 511 | return status; | ||
| 508 | } | 512 | } |
| 509 | 513 | ||
| 510 | 514 | ||