summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2023-06-15 17:51:24 +0200
committerGravatar default2023-06-15 17:51:24 +0200
commit478cb2cf15324289884847412b61b193f51fb532 (patch)
treeb2b38e64b6baa581f775be01d4f9e2ec184a8e92 /html.c
parentBackport from xs. (diff)
downloadsnac2-478cb2cf15324289884847412b61b193f51fb532.tar.gz
snac2-478cb2cf15324289884847412b61b193f51fb532.tar.xz
snac2-478cb2cf15324289884847412b61b193f51fb532.zip
Use xs_stock_* values wherever possible.
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 5 insertions, 9 deletions
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,
1851 msg = msg_note(&snac, content_2, to, in_reply_to, attach_list, priv); 1851 msg = msg_note(&snac, content_2, to, in_reply_to, attach_list, priv);
1852 1852
1853 if (sensitive != NULL) { 1853 if (sensitive != NULL) {
1854 xs *t = xs_val_new(XSTYPE_TRUE); 1854 msg = xs_dict_set(msg, "sensitive", xs_stock_true);
1855
1856 msg = xs_dict_set(msg, "sensitive", t);
1857 msg = xs_dict_set(msg, "summary", "..."); 1855 msg = xs_dict_set(msg, "summary", "...");
1858 } 1856 }
1859 1857
@@ -2010,8 +2008,6 @@ int html_post_handler(const xs_dict *req, const char *q_path,
2010 /* change of user data */ 2008 /* change of user data */
2011 char *v; 2009 char *v;
2012 char *p1, *p2; 2010 char *p1, *p2;
2013 xs *byes = xs_val_new(XSTYPE_TRUE);
2014 xs *bno = xs_val_new(XSTYPE_FALSE);
2015 2011
2016 if ((v = xs_dict_get(p_vars, "name")) != NULL) 2012 if ((v = xs_dict_get(p_vars, "name")) != NULL)
2017 snac.config = xs_dict_set(snac.config, "name", v); 2013 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,
2036 snac.config = xs_dict_set(snac.config, "purge_days", days); 2032 snac.config = xs_dict_set(snac.config, "purge_days", days);
2037 } 2033 }
2038 if ((v = xs_dict_get(p_vars, "drop_dm_from_unknown")) != NULL && strcmp(v, "on") == 0) 2034 if ((v = xs_dict_get(p_vars, "drop_dm_from_unknown")) != NULL && strcmp(v, "on") == 0)
2039 snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", byes); 2035 snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", xs_stock_true);
2040 else 2036 else
2041 snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", bno); 2037 snac.config = xs_dict_set(snac.config, "drop_dm_from_unknown", xs_stock_false);
2042 if ((v = xs_dict_get(p_vars, "bot")) != NULL && strcmp(v, "on") == 0) 2038 if ((v = xs_dict_get(p_vars, "bot")) != NULL && strcmp(v, "on") == 0)
2043 snac.config = xs_dict_set(snac.config, "bot", byes); 2039 snac.config = xs_dict_set(snac.config, "bot", xs_stock_true);
2044 else 2040 else
2045 snac.config = xs_dict_set(snac.config, "bot", bno); 2041 snac.config = xs_dict_set(snac.config, "bot", xs_stock_false);
2046 2042
2047 /* avatar upload */ 2043 /* avatar upload */
2048 xs_list *avatar_file = xs_dict_get(p_vars, "avatar_file"); 2044 xs_list *avatar_file = xs_dict_get(p_vars, "avatar_file");