From 478cb2cf15324289884847412b61b193f51fb532 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 15 Jun 2023 17:51:24 +0200 Subject: Use xs_stock_* values wherever possible. --- html.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index b652064..b580faf 100644 --- a/html.c +++ b/html.c @@ -1851,9 +1851,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, msg = msg_note(&snac, content_2, to, in_reply_to, attach_list, priv); if (sensitive != NULL) { - xs *t = xs_val_new(XSTYPE_TRUE); - - msg = xs_dict_set(msg, "sensitive", t); + msg = xs_dict_set(msg, "sensitive", xs_stock_true); msg = xs_dict_set(msg, "summary", "..."); } @@ -2010,8 +2008,6 @@ int html_post_handler(const xs_dict *req, const char *q_path, /* change of user data */ char *v; char *p1, *p2; - xs *byes = xs_val_new(XSTYPE_TRUE); - xs *bno = xs_val_new(XSTYPE_FALSE); if ((v = xs_dict_get(p_vars, "name")) != NULL) snac.config = xs_dict_set(snac.config, "name", v); @@ -2036,13 +2032,13 @@ int html_post_handler(const xs_dict *req, const char *q_path, snac.config = xs_dict_set(snac.config, "purge_days", days); } if ((v = xs_dict_get(p_vars, "drop_dm_from_unknown")) != NULL && strcmp(v, "on") == 0) - snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", byes); + snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", xs_stock_true); else - snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", bno); + snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", xs_stock_false); if ((v = xs_dict_get(p_vars, "bot")) != NULL && strcmp(v, "on") == 0) - snac.config = xs_dict_set(snac.config, "bot", byes); + snac.config = xs_dict_set(snac.config, "bot", xs_stock_true); else - snac.config = xs_dict_set(snac.config, "bot", bno); + snac.config = xs_dict_set(snac.config, "bot", xs_stock_false); /* avatar upload */ xs_list *avatar_file = xs_dict_get(p_vars, "avatar_file"); -- cgit v1.2.3