summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-02-20 10:19:15 +0100
committerGravatar default2023-02-20 10:19:15 +0100
commitfdda3c9235e7a65699acf82816536265dd999cf7 (patch)
tree61a045e95222066263c172cc8996a428350a6492
parentUpdated RELEASE_NOTES. (diff)
downloadpenes-snac2-fdda3c9235e7a65699acf82816536265dd999cf7.tar.gz
penes-snac2-fdda3c9235e7a65699acf82816536265dd999cf7.tar.xz
penes-snac2-fdda3c9235e7a65699acf82816536265dd999cf7.zip
New checkbox 'Only for mentioned people'.
-rw-r--r--html.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/html.c b/html.c
index bfb837b..5cbc665 100644
--- a/html.c
+++ b/html.c
@@ -268,6 +268,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
268 "rows=\"8\" wrap=\"virtual\" required=\"required\"></textarea>\n" 268 "rows=\"8\" wrap=\"virtual\" required=\"required\"></textarea>\n"
269 "<input type=\"hidden\" name=\"in_reply_to\" value=\"\">\n" 269 "<input type=\"hidden\" name=\"in_reply_to\" value=\"\">\n"
270 "<p>%s: <input type=\"checkbox\" name=\"sensitive\">\n" 270 "<p>%s: <input type=\"checkbox\" name=\"sensitive\">\n"
271 "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n"
271 "<p><input type=\"file\" name=\"attach\">\n" 272 "<p><input type=\"file\" name=\"attach\">\n"
272 "<p>%s: <input type=\"text\" name=\"alt_text\">\n" 273 "<p>%s: <input type=\"text\" name=\"alt_text\">\n"
273 "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n" 274 "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n"
@@ -360,6 +361,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
360 xs *s1 = xs_fmt(_tmpl, 361 xs *s1 = xs_fmt(_tmpl,
361 snac->actor, 362 snac->actor,
362 L("Sensitive content"), 363 L("Sensitive content"),
364 L("Only for mentioned people"),
363 L("Image description"), 365 L("Image description"),
364 L("Post"), 366 L("Post"),
365 367
@@ -527,6 +529,7 @@ d_char *html_entry_controls(snac *snac, d_char *os, char *msg, const char *md5)
527 "<input type=\"hidden\" name=\"edit_id\" value=\"%s\">\n" 529 "<input type=\"hidden\" name=\"edit_id\" value=\"%s\">\n"
528 530
529 "<p>%s: <input type=\"checkbox\" name=\"sensitive\">\n" 531 "<p>%s: <input type=\"checkbox\" name=\"sensitive\">\n"
532 "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n"
530 "<p><input type=\"file\" name=\"attach\">\n" 533 "<p><input type=\"file\" name=\"attach\">\n"
531 "<p>%s: <input type=\"text\" name=\"alt_text\">\n" 534 "<p>%s: <input type=\"text\" name=\"alt_text\">\n"
532 535
@@ -542,6 +545,7 @@ d_char *html_entry_controls(snac *snac, d_char *os, char *msg, const char *md5)
542 prev_src, 545 prev_src,
543 id, 546 id,
544 L("Sensitive content"), 547 L("Sensitive content"),
548 L("Only for mentioned people"),
545 L("Image description"), 549 L("Image description"),
546 md5, 550 md5,
547 L("Post") 551 L("Post")
@@ -564,6 +568,7 @@ d_char *html_entry_controls(snac *snac, d_char *os, char *msg, const char *md5)
564 "<input type=\"hidden\" name=\"in_reply_to\" value=\"%s\">\n" 568 "<input type=\"hidden\" name=\"in_reply_to\" value=\"%s\">\n"
565 569
566 "<p>%s: <input type=\"checkbox\" name=\"sensitive\">\n" 570 "<p>%s: <input type=\"checkbox\" name=\"sensitive\">\n"
571 "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n"
567 "<p><input type=\"file\" name=\"attach\">\n" 572 "<p><input type=\"file\" name=\"attach\">\n"
568 "<p>%s: <input type=\"text\" name=\"alt_text\">\n" 573 "<p>%s: <input type=\"text\" name=\"alt_text\">\n"
569 574
@@ -579,6 +584,7 @@ d_char *html_entry_controls(snac *snac, d_char *os, char *msg, const char *md5)
579 ct, 584 ct,
580 id, 585 id,
581 L("Sensitive content"), 586 L("Sensitive content"),
587 L("Only for mentioned people"),
582 L("Image description"), 588 L("Image description"),
583 md5, 589 md5,
584 L("Post") 590 L("Post")
@@ -1353,7 +1359,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1353 int status = 0; 1359 int status = 0;
1354 snac snac; 1360 snac snac;
1355 char *uid, *p_path; 1361 char *uid, *p_path;
1356 char *p_vars; 1362 xs_dict *p_vars;
1357 1363
1358 xs *l = xs_split_n(q_path, "/", 2); 1364 xs *l = xs_split_n(q_path, "/", 2);
1359 1365
@@ -1383,16 +1389,16 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1383 1389
1384 if (p_path && strcmp(p_path, "admin/note") == 0) { 1390 if (p_path && strcmp(p_path, "admin/note") == 0) {
1385 /* post note */ 1391 /* post note */
1386 char *content = xs_dict_get(p_vars, "content"); 1392 xs_str *content = xs_dict_get(p_vars, "content");
1387 char *in_reply_to = xs_dict_get(p_vars, "in_reply_to"); 1393 xs_str *in_reply_to = xs_dict_get(p_vars, "in_reply_to");
1388 char *attach_url = xs_dict_get(p_vars, "attach_url"); 1394 xs_str *attach_url = xs_dict_get(p_vars, "attach_url");
1389 char *attach_file = xs_dict_get(p_vars, "attach"); 1395 xs_list *attach_file = xs_dict_get(p_vars, "attach");
1390 char *to = xs_dict_get(p_vars, "to"); 1396 xs_str *to = xs_dict_get(p_vars, "to");
1391 char *sensitive = xs_dict_get(p_vars, "sensitive"); 1397 xs_str *sensitive = xs_dict_get(p_vars, "sensitive");
1392 char *edit_id = xs_dict_get(p_vars, "edit_id"); 1398 xs_str *edit_id = xs_dict_get(p_vars, "edit_id");
1393 char *alt_text = xs_dict_get(p_vars, "alt_text"); 1399 xs_str *alt_text = xs_dict_get(p_vars, "alt_text");
1394 xs *attach_list = xs_list_new(); 1400 int priv = !xs_is_null(xs_dict_get(p_vars, "mentioned_only"));
1395 int priv = 0; 1401 xs *attach_list = xs_list_new();
1396 1402
1397 /* default alt text */ 1403 /* default alt text */
1398 if (xs_is_null(alt_text)) 1404 if (xs_is_null(alt_text))