aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-06-02 09:19:38 +0200
committergrunfink <grunfink@comam.es>2026-06-02 09:19:38 +0200
commit41fea226322ca945ffec574a2f69d0b6adb63ff2 (patch)
treed1c6dead108be762e1b2d07ce229b86f7bd118ce
parent1adf45de30921ae727af2dd1302615e33e8181ba (diff)
New user directive: 'excluded_langs'.
-rw-r--r--html.c11
1 files changed, 11 insertions, 0 deletions
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) {