diff options
| author | 2022-11-24 13:15:32 +0100 | |
|---|---|---|
| committer | 2022-11-24 13:15:32 +0100 | |
| commit | 8a71e2e557af62c9d3c89b519c4e98dd26dbc859 (patch) | |
| tree | 1fe1745a5ab8c52588c04a608695a07ce74954b4 | |
| parent | Use index_in() in object_admire() to avoid admiring more than once. (diff) | |
| download | snac2-8a71e2e557af62c9d3c89b519c4e98dd26dbc859.tar.gz snac2-8a71e2e557af62c9d3c89b519c4e98dd26dbc859.tar.xz snac2-8a71e2e557af62c9d3c89b519c4e98dd26dbc859.zip | |
Only log the object_admire() if it's new.
| -rw-r--r-- | data.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -503,11 +503,12 @@ int object_admire(const char *id, const char *actor, int like) | |||
| 503 | 503 | ||
| 504 | fn = xs_replace_i(fn, ".json", like ? "_l.idx" : "_a.idx"); | 504 | fn = xs_replace_i(fn, ".json", like ? "_l.idx" : "_a.idx"); |
| 505 | 505 | ||
| 506 | srv_debug(0, xs_fmt("object_admire (%s) %s %s", like ? "Like" : "Announce", actor, fn)); | 506 | if (!index_in(fn, actor)) { |
| 507 | |||
| 508 | if (!index_in(fn, actor)) | ||
| 509 | status = index_add(fn, actor); | 507 | status = index_add(fn, actor); |
| 510 | 508 | ||
| 509 | srv_debug(0, xs_fmt("object_admire (%s) %s %s", like ? "Like" : "Announce", actor, fn)); | ||
| 510 | } | ||
| 511 | |||
| 511 | return status; | 512 | return status; |
| 512 | } | 513 | } |
| 513 | 514 | ||