summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-08-09 14:34:22 +0200
committerdefault <nobody@localhost>2023-08-09 14:34:22 +0200
commit84e8cb419ba95a53ae4d2a1c9f4bb60d55dfc5f5 (patch)
tree33d202f27b2ce2dbd2ad5c66eaff0e7ed2b0ccaf
parentb3797d24162bd2c8637d267ae0a08f3cd6e45dff (diff)
Added web interface for hide_followers_only.
-rw-r--r--html.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/html.c b/html.c
index 0fe4ad8..8f3fb06 100644
--- a/html.c
+++ b/html.c
@@ -486,6 +486,9 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
"<p><input type=\"checkbox\" name=\"bot\" id=\"bot\" %s>\n"
"<label for=\"bot\">%s</label></p>\n"
+ "<p><input type=\"checkbox\" name=\"hide_followers_only\" id=\"hide_followers_only\" %s>\n"
+ "<label for=\"hide_followers_only\">%s</label></p>\n"
+
"<p>%s:<br>\n"
"<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n"
@@ -541,6 +544,8 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
xs *es5 = encode_html(telegram_chat_id);
xs *es6 = encode_html(purge_days);
+ const char *hfo = xs_dict_get(snac->config, "hide_followers_only");
+
xs *s1 = xs_fmt(_tmpl,
L("New Post..."),
snac->actor,
@@ -590,6 +595,8 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
L("Drop direct messages from people you don't follow"),
xs_type(bot) == XSTYPE_TRUE ? "checked" : "",
L("This account is a bot"),
+ xs_type(hfo) == XSTYPE_TRUE ? "checked" : "",
+ L("Hide posts for followers only (and not for you)"),
L("New password"),
L("Repeat new password"),
L("Update user info")
@@ -2292,6 +2299,10 @@ int html_post_handler(const xs_dict *req, const char *q_path,
snac.config = xs_dict_set(snac.config, "bot", xs_stock_true);
else
snac.config = xs_dict_set(snac.config, "bot", xs_stock_false);
+ if ((v = xs_dict_get(p_vars, "hide_followers_only")) != NULL && strcmp(v, "on") == 0)
+ snac.config = xs_dict_set(snac.config, "hide_followers_only", xs_stock_true);
+ else
+ snac.config = xs_dict_set(snac.config, "hide_followers_only", xs_stock_false);
/* avatar upload */
xs_list *avatar_file = xs_dict_get(p_vars, "avatar_file");