diff options
| author | 2024-07-03 13:34:22 +0200 | |
|---|---|---|
| committer | 2024-07-03 13:34:22 +0200 | |
| commit | 4175c7022649cfd5446cc32fca5d16139f7b494d (patch) | |
| tree | b70873b579b248d679e5510993fd098d84359e7e /html.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-4175c7022649cfd5446cc32fca5d16139f7b494d.tar.gz snac2-4175c7022649cfd5446cc32fca5d16139f7b494d.tar.xz snac2-4175c7022649cfd5446cc32fca5d16139f7b494d.zip | |
Added web UI for the auto-boost option.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 15 |
1 files changed, 15 insertions, 0 deletions
| @@ -1001,6 +1001,7 @@ xs_html *html_top_controls(snac *snac) | |||
| 1001 | const xs_val *d_dm_f_u = xs_dict_get(snac->config, "drop_dm_from_unknown"); | 1001 | const xs_val *d_dm_f_u = xs_dict_get(snac->config, "drop_dm_from_unknown"); |
| 1002 | const xs_val *bot = xs_dict_get(snac->config, "bot"); | 1002 | const xs_val *bot = xs_dict_get(snac->config, "bot"); |
| 1003 | const xs_val *a_private = xs_dict_get(snac->config, "private"); | 1003 | const xs_val *a_private = xs_dict_get(snac->config, "private"); |
| 1004 | const xs_val *auto_boost = xs_dict_get(snac->config, "auto_boost"); | ||
| 1004 | 1005 | ||
| 1005 | xs *metadata = xs_str_new(NULL); | 1006 | xs *metadata = xs_str_new(NULL); |
| 1006 | const xs_dict *md = xs_dict_get(snac->config, "metadata"); | 1007 | const xs_dict *md = xs_dict_get(snac->config, "metadata"); |
| @@ -1138,6 +1139,15 @@ xs_html *html_top_controls(snac *snac) | |||
| 1138 | xs_html_tag("p", | 1139 | xs_html_tag("p", |
| 1139 | xs_html_sctag("input", | 1140 | xs_html_sctag("input", |
| 1140 | xs_html_attr("type", "checkbox"), | 1141 | xs_html_attr("type", "checkbox"), |
| 1142 | xs_html_attr("name", "auto_boost"), | ||
| 1143 | xs_html_attr("id", "auto_boost"), | ||
| 1144 | xs_html_attr(xs_is_true(auto_boost) ? "checked" : "", NULL)), | ||
| 1145 | xs_html_tag("label", | ||
| 1146 | xs_html_attr("for", "auto_boost"), | ||
| 1147 | xs_html_text(L("Auto-boost all mentions to this account")))), | ||
| 1148 | xs_html_tag("p", | ||
| 1149 | xs_html_sctag("input", | ||
| 1150 | xs_html_attr("type", "checkbox"), | ||
| 1141 | xs_html_attr("name", "private"), | 1151 | xs_html_attr("name", "private"), |
| 1142 | xs_html_attr("id", "private"), | 1152 | xs_html_attr("id", "private"), |
| 1143 | xs_html_attr(xs_type(a_private) == XSTYPE_TRUE ? "checked" : "", NULL)), | 1153 | xs_html_attr(xs_type(a_private) == XSTYPE_TRUE ? "checked" : "", NULL)), |
| @@ -3337,6 +3347,11 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3337 | snac.config = xs_dict_set(snac.config, "private", xs_stock(XSTYPE_TRUE)); | 3347 | snac.config = xs_dict_set(snac.config, "private", xs_stock(XSTYPE_TRUE)); |
| 3338 | else | 3348 | else |
| 3339 | snac.config = xs_dict_set(snac.config, "private", xs_stock(XSTYPE_FALSE)); | 3349 | snac.config = xs_dict_set(snac.config, "private", xs_stock(XSTYPE_FALSE)); |
| 3350 | if ((v = xs_dict_get(p_vars, "auto_boost")) != NULL && strcmp(v, "on") == 0) | ||
| 3351 | snac.config = xs_dict_set(snac.config, "auto_boost", xs_stock(XSTYPE_TRUE)); | ||
| 3352 | else | ||
| 3353 | snac.config = xs_dict_set(snac.config, "auto_boost", xs_stock(XSTYPE_FALSE)); | ||
| 3354 | |||
| 3340 | if ((v = xs_dict_get(p_vars, "metadata")) != NULL) { | 3355 | if ((v = xs_dict_get(p_vars, "metadata")) != NULL) { |
| 3341 | /* split the metadata and store it as a dict */ | 3356 | /* split the metadata and store it as a dict */ |
| 3342 | xs_dict *md = xs_dict_new(); | 3357 | xs_dict *md = xs_dict_new(); |