commit 40592fb

grunfink  ·  2025-08-12 09:00:19 +0000 UTC
parent 944394e
post_langs can now be set from the user settings.
1 files changed,  +12, -0
M html.c
M html.c
+12, -0
 1@@ -1346,6 +1346,7 @@ xs_html *html_top_controls(snac *user)
 2     const char *latitude     = xs_dict_get_def(user->config, "latitude", "");
 3     const char *longitude    = xs_dict_get_def(user->config, "longitude", "");
 4     const char *webhook      = xs_dict_get_def(user->config, "notify_webhook", "");
 5+    const char *post_langs   = xs_dict_get_def(user->config, "post_langs", "");
 6 
 7     xs *metadata = NULL;
 8     const xs_dict *md = xs_dict_get(user->config, "metadata");
 9@@ -1621,6 +1622,15 @@ xs_html *html_top_controls(snac *user)
10                     xs_html_sctag("br", NULL),
11                     tz_select),
12 
13+                xs_html_tag("p",
14+                    xs_html_text(L("Languages you usually post in:")),
15+                    xs_html_sctag("br", NULL),
16+                    xs_html_sctag("input",
17+                        xs_html_attr("type", "next"),
18+                        xs_html_attr("name", "post_langs"),
19+                        xs_html_attr("value", post_langs),
20+                        xs_html_attr("placeholder", L("en fr es de_AT")))),
21+
22                 xs_html_tag("p",
23                     xs_html_text(L("New password:")),
24                     xs_html_sctag("br", NULL),
25@@ -4924,6 +4934,8 @@ int html_post_handler(const xs_dict *req, const char *q_path,
26             snac.config = xs_dict_set(snac.config, "lang", v);
27         if ((v = xs_dict_get(p_vars, "tz")) != NULL)
28             snac.config = xs_dict_set(snac.config, "tz", v);
29+        if ((v = xs_dict_get(p_vars, "post_langs")) != NULL)
30+            snac.config = xs_dict_set(snac.config, "post_langs", v);
31 
32         snac.config = xs_dict_set(snac.config, "latitude", xs_dict_get_def(p_vars, "latitude", ""));
33         snac.config = xs_dict_set(snac.config, "longitude", xs_dict_get_def(p_vars, "longitude", ""));