Fixed status codes for follower_add() and follower_del().

This commit is contained in:
default 2022-11-28 11:24:19 +01:00
parent 3c7cccba3d
commit 5309a68e95

8
data.c
View file

@ -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;
}