mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Reject MUTEd actor messages ASAP with a 403 status.
This commit is contained in:
parent
1254602afb
commit
79ea0bf4ab
@ -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)) {
|
if (valid_status(status)) {
|
||||||
enqueue_input(&snac, msg, req, 0);
|
enqueue_input(&snac, msg, req, 0);
|
||||||
*ctype = "application/activity+json";
|
*ctype = "application/activity+json";
|
||||||
|
Loading…
Reference in New Issue
Block a user