commit a5326cd
grunfink
·
2026-04-10 14:59:20 +0000 UTC
parent d704c79
Added web UI settings for the 'show_unlisted' toggle.
1 files changed,
+7,
-0
M
html.c
M
html.c
+7,
-0
1@@ -1602,6 +1602,7 @@ xs_html *html_top_controls(snac *user)
2 const xs_val *coll_thrds = xs_dict_get(user->config, "collapse_threads");
3 const xs_val *pending = xs_dict_get(user->config, "approve_followers");
4 const xs_val *show_foll = xs_dict_get(user->config, "show_contact_metrics");
5+ const xs_val *show_unlisted = xs_dict_get(user->config, "show_unlisted");
6 const char *latitude = xs_dict_get_def(user->config, "latitude", "");
7 const char *longitude = xs_dict_get_def(user->config, "longitude", "");
8 const char *webhook = xs_dict_get_def(user->config, "notify_webhook", "");
9@@ -1797,6 +1798,8 @@ xs_html *html_top_controls(snac *user)
10 xs_is_true(pending)),
11 html_checkbox("show_contact_metrics", L("Publish follower and following metrics"),
12 xs_is_true(show_foll)),
13+ html_checkbox("show_unlisted", L("Show unlisted posts in the public page and RSS feed"),
14+ xs_is_true(show_unlisted)),
15 xs_html_tag("p",
16 xs_html_text(L("Current location:")),
17 xs_html_sctag("br", NULL),
18@@ -5878,6 +5881,10 @@ int html_post_handler(const xs_dict *req, const char *q_path,
19 snac.config = xs_dict_set(snac.config, "show_contact_metrics", xs_stock(XSTYPE_TRUE));
20 else
21 snac.config = xs_dict_set(snac.config, "show_contact_metrics", xs_stock(XSTYPE_FALSE));
22+ if ((v = xs_dict_get(p_vars, "show_unlisted")) != NULL && strcmp(v, "on") == 0)
23+ snac.config = xs_dict_set(snac.config, "show_unlisted", xs_stock(XSTYPE_TRUE));
24+ else
25+ snac.config = xs_dict_set(snac.config, "show_unlisted", xs_stock(XSTYPE_FALSE));
26 if ((v = xs_dict_get(p_vars, "web_ui_lang")) != NULL)
27 snac.config = xs_dict_set(snac.config, "lang", v);
28 if ((v = xs_dict_get(p_vars, "tz")) != NULL)