diff --git a/data.c b/data.c index 53706c6..0866e31 100644 --- a/data.c +++ b/data.c @@ -79,7 +79,7 @@ int srv_open(char *basedir) if (error != NULL) srv_log(error); -/* disabled temporarily; messages can't be sent */ +/* disabled temporarily; messages can't be sent (libcurl issue?) */ #if 0 #ifdef __OpenBSD__ srv_debug(2, xs_fmt("Calling unveil()")); diff --git a/html.c b/html.c index 7b87fc8..8fb3892 100644 --- a/html.c +++ b/html.c @@ -242,6 +242,7 @@ d_char *html_top_controls(snac *snac, d_char *s) "\n" "\n" + "

%s\n" "

\n" "

\n" "

\n" @@ -297,6 +298,7 @@ d_char *html_top_controls(snac *snac, d_char *s) xs *s1 = xs_fmt(_tmpl, snac->actor, + L("Sensitive content"), L("Post"), L("More options..."), @@ -1120,6 +1122,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, char *attach_url = xs_dict_get(p_vars, "attach_url"); char *attach_file = xs_dict_get(p_vars, "attach"); char *to = xs_dict_get(p_vars, "to"); + char *sensitive = xs_dict_get(p_vars, "sensitive"); xs *attach_list = xs_list_new(); /* is attach_url set? */ @@ -1152,6 +1155,13 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, msg = msg_note(&snac, content_2, to, in_reply_to, attach_list); + if (sensitive != NULL) { + xs *t = xs_val_new(XSTYPE_TRUE); + + msg = xs_dict_set(msg, "sensitive", t); + msg = xs_dict_set(msg, "summary", "..."); + } + c_msg = msg_create(&snac, msg); post(&snac, c_msg);