From 40592fb3d4b6519f611a25048481c19ce92b1cbe Mon Sep 17 00:00:00 2001 From: grunfink Date: Tue, 12 Aug 2025 11:00:19 +0200 Subject: post_langs can now be set from the user settings. --- html.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'html.c') diff --git a/html.c b/html.c index 5740d82..00da602 100644 --- a/html.c +++ b/html.c @@ -1346,6 +1346,7 @@ xs_html *html_top_controls(snac *user) const char *latitude = xs_dict_get_def(user->config, "latitude", ""); const char *longitude = xs_dict_get_def(user->config, "longitude", ""); const char *webhook = xs_dict_get_def(user->config, "notify_webhook", ""); + const char *post_langs = xs_dict_get_def(user->config, "post_langs", ""); xs *metadata = NULL; const xs_dict *md = xs_dict_get(user->config, "metadata"); @@ -1621,6 +1622,15 @@ xs_html *html_top_controls(snac *user) xs_html_sctag("br", NULL), tz_select), + xs_html_tag("p", + xs_html_text(L("Languages you usually post in:")), + xs_html_sctag("br", NULL), + xs_html_sctag("input", + xs_html_attr("type", "next"), + xs_html_attr("name", "post_langs"), + xs_html_attr("value", post_langs), + xs_html_attr("placeholder", L("en fr es de_AT")))), + xs_html_tag("p", xs_html_text(L("New password:")), xs_html_sctag("br", NULL), @@ -4924,6 +4934,8 @@ int html_post_handler(const xs_dict *req, const char *q_path, snac.config = xs_dict_set(snac.config, "lang", v); if ((v = xs_dict_get(p_vars, "tz")) != NULL) snac.config = xs_dict_set(snac.config, "tz", v); + if ((v = xs_dict_get(p_vars, "post_langs")) != NULL) + snac.config = xs_dict_set(snac.config, "post_langs", v); snac.config = xs_dict_set(snac.config, "latitude", xs_dict_get_def(p_vars, "latitude", "")); snac.config = xs_dict_set(snac.config, "longitude", xs_dict_get_def(p_vars, "longitude", "")); -- cgit v1.2.3