snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 203db3b09e3ebf8677f75e83e5470b99c74de470
parent 22d05cded1f1cb23b90ded9f9c1ad24b02718c2b
Author: default <nobody@localhost>
Date:   Wed,  4 Dec 2024 05:51:17 +0100

Fixed bug in blocked instance rejection.

Diffstat:
Mhtml.c | 3+++
Mmastoapi.c | 3+++
Msnac.h | 2+-
3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/html.c b/html.c @@ -1524,6 +1524,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, if ((read_only || !user) && !is_msg_public(msg)) return NULL; + if (is_instance_blocked(id)) + return NULL; + if (user && level == 0 && xs_is_true(xs_dict_get(user->config, "collapse_threads"))) collapse_threads = 1; diff --git a/mastoapi.c b/mastoapi.c @@ -1349,6 +1349,9 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn if (!xs_match(type, POSTLIKE_OBJECT_TYPE)) continue; + if (is_instance_blocked(id)) + continue; + const char *from = NULL; if (strcmp(type, "Page") == 0) from = xs_dict_get(msg, "audience"); diff --git a/snac.h b/snac.h @@ -1,7 +1,7 @@ /* snac - A simple, minimalistic ActivityPub instance */ /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ -#define VERSION "2.65" +#define VERSION "2.66-dev" #define USER_AGENT "snac/" VERSION