From 8e521cce1f980edb6ce0bfd490e93e8ab5baa93a Mon Sep 17 00:00:00 2001 From: grunfink Date: Sun, 30 Aug 2026 16:46:38 +0200 Subject: Added notification filter for Webmentions. --- html.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'html.c') diff --git a/html.c b/html.c index b26c252..3ba48d7 100644 --- a/html.c +++ b/html.c @@ -4246,6 +4246,7 @@ void notify_filter(snac *user, const xs_dict *p_vars) int folreq_on = (v = xs_dict_get(p_vars, "folreqs_on")) ? strcmp(v, "on") == 0 : 0; int blocks_on = (v = xs_dict_get(p_vars, "blocks_on")) ? strcmp(v, "on") == 0 : 0; int polls_on = (v = xs_dict_get(p_vars, "polls_on")) ? strcmp(v, "on") == 0 : 0; + int webmen_on = (v = xs_dict_get(p_vars, "webmentions_on")) ? strcmp(v, "on") == 0 : 0; xs *filter = xs_dict_new(); filter = xs_dict_set(filter, "likes", xs_stock(likes_on ? XSTYPE_TRUE : XSTYPE_FALSE)); filter = xs_dict_set(filter, "reacts", xs_stock(reacts_on ? XSTYPE_TRUE : XSTYPE_FALSE)); @@ -4256,6 +4257,7 @@ void notify_filter(snac *user, const xs_dict *p_vars) filter = xs_dict_set(filter, "folreqs", xs_stock(folreq_on ? XSTYPE_TRUE : XSTYPE_FALSE)); filter = xs_dict_set(filter, "blocks", xs_stock(blocks_on ? XSTYPE_TRUE : XSTYPE_FALSE)); filter = xs_dict_set(filter, "polls", xs_stock(polls_on ? XSTYPE_TRUE : XSTYPE_FALSE)); + filter = xs_dict_set(filter, "webmentions", xs_stock(webmen_on ? XSTYPE_TRUE : XSTYPE_FALSE)); user->config = xs_dict_set(user->config, "notify_filter", filter); user->tz = xs_dict_get_def(user->config, "tz", "UTC"); // previous line invalidates user->tz } @@ -4290,6 +4292,7 @@ xs_str *html_notifications(snac *user, int skip, int show) int n_folreq_on = xs_is_true(xs_dict_get_def(n_filter, "folreqs", n_def)); int n_blocks_on = xs_is_true(xs_dict_get_def(n_filter, "blocks", n_def)); int n_polls_on = xs_is_true(xs_dict_get_def(n_filter, "polls", n_def)); + int n_webmen_on = xs_is_true(xs_dict_get_def(n_filter, "webmentions", n_def)); xs_html *html = xs_html_tag("html", html_user_head(user, NULL, NULL), @@ -4316,6 +4319,7 @@ xs_str *html_notifications(snac *user, int skip, int show) html_checkbox("folreqs_on", L("Follow requests"), n_folreq_on), html_checkbox("blocks_on", L("Blocks"), n_blocks_on), html_checkbox("polls_on", L("Polls"), n_polls_on), + html_checkbox("webmentions_on", L("Webmentions"), n_webmen_on), xs_html_sctag("input", xs_html_attr("type", "submit"), xs_html_attr("class", "button"), -- cgit