commit 41fea22

grunfink  ·  2026-06-02 07:19:38 +0000 UTC
parent 1adf45d
New user directive: 'excluded_langs'.
1 files changed,  +11, -0
M html.c
M html.c
+11, -0
 1@@ -2339,6 +2339,17 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
 2         int c = 0;
 3 
 4         xs_dict_next(cmap, &lang, &dummy, &c);
 5+
 6+        if (user && xs_is_string(lang)) {
 7+            /* discard posts in excluded languages */
 8+            const char *excluded_langs = xs_dict_get(user->config, "excluded_langs");
 9+
10+            if (xs_is_string(excluded_langs) &&
11+                xs_str_in(excluded_langs, lang) != -1) {
12+                snac_debug(user, 1, xs_fmt("excluded post in language '%s'", lang));
13+                return NULL;
14+            }
15+        }
16     }
17 
18     if (strcmp(type, "Follow") == 0) {