summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-03-04 00:26:50 +0100
committerdefault <nobody@localhost>2023-03-04 00:26:50 +0100
commit79ea0bf4abdd4acbe830b10aab20c7f0d8f84f40 (patch)
treecd38ed874a25e1d5a295bd901d481b98cb24ddd6 /activitypub.c
parent1254602afbda89101e1fca5ec978701eb7017395 (diff)
Reject MUTEd actor messages ASAP with a 403 status.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index c6cf445..1c49f82 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1484,6 +1484,17 @@ int activitypub_post_handler(d_char *req, char *q_path,
}
}
+ /* if the message is from a muted actor, reject it right now */
+ if (!xs_is_null(v = xs_dict_get(msg, "actor")) && *v) {
+ if (is_muted(&snac, v)) {
+ srv_log(xs_fmt("rejected message from MUTEd actor %s", v));
+
+ *body = xs_str_new("rejected");
+ *ctype = "text/plain";
+ status = 403;
+ }
+ }
+
if (valid_status(status)) {
enqueue_input(&snac, msg, req, 0);
*ctype = "application/activity+json";