From 41fea226322ca945ffec574a2f69d0b6adb63ff2 Mon Sep 17 00:00:00 2001 From: grunfink Date: Tue, 2 Jun 2026 09:19:38 +0200 Subject: New user directive: 'excluded_langs'. --- html.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/html.c b/html.c index 76d211c..6ddd252 100644 --- a/html.c +++ b/html.c @@ -2339,6 +2339,17 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, int c = 0; xs_dict_next(cmap, &lang, &dummy, &c); + + if (user && xs_is_string(lang)) { + /* discard posts in excluded languages */ + const char *excluded_langs = xs_dict_get(user->config, "excluded_langs"); + + if (xs_is_string(excluded_langs) && + xs_str_in(excluded_langs, lang) != -1) { + snac_debug(user, 1, xs_fmt("excluded post in language '%s'", lang)); + return NULL; + } + } } if (strcmp(type, "Follow") == 0) { -- cgit