From 5309a68e95ffaacb01eb2571501bdde80b3a550d Mon Sep 17 00:00:00 2001 From: default Date: Mon, 28 Nov 2022 11:24:19 +0100 Subject: [PATCH] Fixed status codes for follower_add() and follower_del(). --- data.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data.c b/data.c index dda1550..51ee2c7 100644 --- a/data.c +++ b/data.c @@ -656,22 +656,22 @@ d_char *object_user_cache_list(snac *snac, const char *cachedir, int max) int follower_add(snac *snac, const char *actor) /* adds a follower */ { - int status = object_user_cache_add(snac, actor, "followers"); + int ret = object_user_cache_add(snac, actor, "followers"); snac_debug(snac, 2, xs_fmt("follower_add %s %s", actor)); - return status; + return ret == -1 ? 500 : 200; } int follower_del(snac *snac, const char *actor) /* deletes a follower */ { - int status = object_user_cache_del(snac, actor, "followers"); + int ret = object_user_cache_del(snac, actor, "followers"); snac_debug(snac, 2, xs_fmt("follower_del %s %s", actor)); - return status; + return ret == -1 ? 404 : 200; }