From 1a42fdc8bd4d5dc045a87108e73dcda4f633266b Mon Sep 17 00:00:00 2001 From: grunfink Date: Fri, 24 Oct 2025 05:02:28 +0200 Subject: Keep track of deleted users and return 410 Gone for them. --- activitypub.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index 2d53cbe..0368ac8 100644 --- a/activitypub.c +++ b/activitypub.c @@ -3660,8 +3660,9 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path, uid = xs_list_get(l, 1); if (!user_open(&snac, uid)) { /* invalid user */ - srv_debug(1, xs_fmt("activitypub_get_handler bad user %s", uid)); - return HTTP_STATUS_NOT_FOUND; + status = grave(uid, 0) ? HTTP_STATUS_GONE : HTTP_STATUS_NOT_FOUND; + srv_debug(1, xs_fmt("activitypub_get_handler bad user %s %d", uid, status)); + return status; } p_path = xs_list_get(l, 2); @@ -3854,8 +3855,9 @@ int activitypub_post_handler(const xs_dict *req, const char *q_path, const char *uid = xs_list_get(l, 1); if (!user_open(&snac, uid)) { /* invalid user */ - srv_debug(1, xs_fmt("activitypub_post_handler bad user %s", uid)); - return HTTP_STATUS_NOT_FOUND; + status = grave(uid, 0) ? HTTP_STATUS_GONE : HTTP_STATUS_NOT_FOUND; + srv_debug(1, xs_fmt("activitypub_post_handler bad user %s %d", uid, status)); + return status; } /* if it has a digest, check it now, because -- cgit v1.2.3