mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Added web interface for drop_dm_from_unknown.
This commit is contained in:
parent
93d1649ba6
commit
b3f2d15d00
1 changed files with 11 additions and 0 deletions
11
html.c
11
html.c
|
@ -392,6 +392,9 @@ d_char *html_top_controls(snac *snac, d_char *s)
|
||||||
"<p>%s:<br>\n"
|
"<p>%s:<br>\n"
|
||||||
"<input type=\"number\" name=\"purge_days\" value=\"%s\"></p>\n"
|
"<input type=\"number\" name=\"purge_days\" value=\"%s\"></p>\n"
|
||||||
|
|
||||||
|
"<p><input type=\"checkbox\" name=\"drop_dm_from_unknown\" id=\"drop_dm_from_unknown\" %s>\n"
|
||||||
|
"<label for=\"drop_dm_from_unknown\">%s</label></p>\n"
|
||||||
|
|
||||||
"<p>%s:<br>\n"
|
"<p>%s:<br>\n"
|
||||||
"<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n"
|
"<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n"
|
||||||
|
|
||||||
|
@ -437,6 +440,8 @@ d_char *html_top_controls(snac *snac, d_char *s)
|
||||||
else
|
else
|
||||||
purge_days = "0";
|
purge_days = "0";
|
||||||
|
|
||||||
|
const char *d_dm_f_u = xs_dict_get(snac->config, "drop_dm_from_unknown");
|
||||||
|
|
||||||
xs *s1 = xs_fmt(_tmpl,
|
xs *s1 = xs_fmt(_tmpl,
|
||||||
snac->actor,
|
snac->actor,
|
||||||
L("Sensitive content"),
|
L("Sensitive content"),
|
||||||
|
@ -469,6 +474,8 @@ d_char *html_top_controls(snac *snac, d_char *s)
|
||||||
telegram_chat_id,
|
telegram_chat_id,
|
||||||
L("Maximum days to keep posts (0: server settings)"),
|
L("Maximum days to keep posts (0: server settings)"),
|
||||||
purge_days,
|
purge_days,
|
||||||
|
xs_type(d_dm_f_u) == XSTYPE_TRUE ? "checked" : "",
|
||||||
|
L("Block direct messages from people you don't follow"),
|
||||||
L("Password (only to change it)"),
|
L("Password (only to change it)"),
|
||||||
L("Repeat Password"),
|
L("Repeat Password"),
|
||||||
L("Update user info")
|
L("Update user info")
|
||||||
|
@ -1818,6 +1825,10 @@ int html_post_handler(const xs_dict *req, const char *q_path,
|
||||||
xs *days = xs_number_new(atof(v));
|
xs *days = xs_number_new(atof(v));
|
||||||
snac.config = xs_dict_set(snac.config, "purge_days", days);
|
snac.config = xs_dict_set(snac.config, "purge_days", days);
|
||||||
}
|
}
|
||||||
|
if ((v = xs_dict_get(p_vars, "drop_dm_from_unknown")) != NULL) {
|
||||||
|
xs *yn = xs_val_new(v && strcmp(v, "on") == 0 ? XSTYPE_TRUE : XSTYPE_FALSE);
|
||||||
|
snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", yn);
|
||||||
|
}
|
||||||
|
|
||||||
/* avatar upload */
|
/* avatar upload */
|
||||||
xs_list *avatar_file = xs_dict_get(p_vars, "avatar_file");
|
xs_list *avatar_file = xs_dict_get(p_vars, "avatar_file");
|
||||||
|
|
Loading…
Reference in a new issue