From 7db4de872d043593b63de09cea27bd350e3e5f58 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 14:07:33 +0200 Subject: Also show unfollows in the notification area. --- html.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 425df4b..ce7f511 100644 --- a/html.c +++ b/html.c @@ -1437,7 +1437,7 @@ xs_str *html_notifications(snac *snac) "
", snac->actor, L("Clear all")); + "
\n", snac->actor, L("Clear all")); s = xs_str_cat(s, s1); while (xs_list_iter(&p, &v)) { @@ -1498,13 +1498,16 @@ xs_str *html_notifications(snac *snac) else if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0) label = L("Finished poll"); + else + if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0) + label = L("Unfollow"); xs *s1 = xs_fmt("
%s by %s:
\n", label, actor_id, a_name); s = xs_str_cat(s, s1); - if (strcmp(type, "Follow") == 0) { + if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { s = xs_str_cat(s, "%s: \n" + "
%s: " + "\n" "
%s: \n"
" %s: \n"
+ " %s: "
+ "\n"
" %s: \n"
" %s: \n"
+ " %s: "
+ "\n"
" %s: \n"
" %s: "
- "\n"
+ " %s: "
+ "\n"
" %s: \n"
" %s: "
- "\n"
+ " %s: "
+ "\n"
" %s: \n"
"%s
\n" /** attach **/
@@ -512,6 +513,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
xs *s1 = xs_fmt(_tmpl,
snac->actor,
L("Sensitive content"),
+ L("Sensitive content description"),
L("Only for mentioned people"),
L("Attach..."),
@@ -697,7 +699,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
"rows=\"4\" wrap=\"virtual\" required=\"required\">%s\n"
"\n"
- "%s
\n"
@@ -717,6 +720,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
prev_src,
id,
L("Sensitive content"),
+ L("Sensitive content description"),
L("Only for mentioned people"),
L("Attach..."),
L("File"),
@@ -741,7 +745,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
"rows=\"4\" wrap=\"virtual\" required=\"required\">%s\n"
"\n"
- "%s
\n"
@@ -761,6 +766,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
ct,
id,
L("Sensitive content"),
+ L("Sensitive content description"),
L("Only for mentioned people"),
L("Attach..."),
L("File"),
@@ -1846,6 +1852,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
xs_list *attach_file = xs_dict_get(p_vars, "attach");
xs_str *to = xs_dict_get(p_vars, "to");
xs_str *sensitive = xs_dict_get(p_vars, "sensitive");
+ xs_str *summary = xs_dict_get(p_vars, "summary");
xs_str *edit_id = xs_dict_get(p_vars, "edit_id");
xs_str *alt_text = xs_dict_get(p_vars, "alt_text");
int priv = !xs_is_null(xs_dict_get(p_vars, "mentioned_only"));
@@ -1924,7 +1931,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
if (sensitive != NULL) {
msg = xs_dict_set(msg, "sensitive", xs_stock_true);
- msg = xs_dict_set(msg, "summary", "...");
+ msg = xs_dict_set(msg, "summary", xs_is_null(summary) ? "..." : summary);
}
if (xs_is_null(edit_id)) {
--
cgit v1.2.3
From 339fe5edc52e90e6a0744c7b96eea5f2071ae39b Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 4 Jul 2023 14:55:24 +0200
Subject: Also fill the sensitive content fields in the edit dialog.
---
html.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'html.c')
diff --git a/html.c b/html.c
index b412f41..46ce5a5 100644
--- a/html.c
+++ b/html.c
@@ -688,6 +688,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) {
xs *prev_src = xs_replace(prev_src1, "<", "<");
+ const xs_val *sensitive = xs_dict_get(msg, "sensitive");
+ const char *summary = xs_dict_get(msg, "summary");
/* post can be edited */
xs *s1 = xs_fmt(
@@ -699,8 +701,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
"rows=\"4\" wrap=\"virtual\" required=\"required\">%s\n"
"\n"
- "%s
\n"
@@ -720,7 +722,9 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
prev_src,
id,
L("Sensitive content"),
+ xs_type(sensitive) == XSTYPE_TRUE ? "checked" : "",
L("Sensitive content description"),
+ summary,
L("Only for mentioned people"),
L("Attach..."),
L("File"),
--
cgit v1.2.3
From 8a392233d22dbcdde794f1a88dcdf812385b4380 Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 4 Jul 2023 15:02:04 +0200
Subject: The content warning check and description is propagated from the
replied message.
---
html.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
(limited to 'html.c')
diff --git a/html.c b/html.c
index 46ce5a5..4a04d7c 100644
--- a/html.c
+++ b/html.c
@@ -686,7 +686,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
const char *prev_src1 = xs_dict_get(msg, "sourceContent");
- if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) {
+ if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) { /** edit **/
xs *prev_src = xs_replace(prev_src1, "<", "<");
const xs_val *sensitive = xs_dict_get(msg, "sensitive");
const char *summary = xs_dict_get(msg, "summary");
@@ -724,7 +724,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
L("Sensitive content"),
xs_type(sensitive) == XSTYPE_TRUE ? "checked" : "",
L("Sensitive content description"),
- summary,
+ xs_is_null(summary) ? "" : summary,
L("Only for mentioned people"),
L("Attach..."),
L("File"),
@@ -736,10 +736,13 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
s = xs_str_cat(s, s1);
}
- {
+ { /** reply **/
/* the post textarea */
xs *ct = build_mentions(snac, msg);
+ const xs_val *sensitive = xs_dict_get(msg, "sensitive");
+ const char *summary = xs_dict_get(msg, "summary");
+
xs *s1 = xs_fmt(
"%s
\n"
"%s
\n"
@@ -770,7 +773,9 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
ct,
id,
L("Sensitive content"),
+ xs_type(sensitive) == XSTYPE_TRUE ? "checked" : "",
L("Sensitive content description"),
+ xs_is_null(summary) ? "" : summary,
L("Only for mentioned people"),
L("Attach..."),
L("File"),
--
cgit v1.2.3
From 38ee86f81e74edec97bf04d999d21221565f44fb Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 4 Jul 2023 17:15:38 +0200
Subject: Also call process_tags() when in the public timeline's bio.
---
html.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'html.c')
diff --git a/html.c b/html.c
index 4a04d7c..2eb542a 100644
--- a/html.c
+++ b/html.c
@@ -362,8 +362,10 @@ d_char *html_user_header(snac *snac, d_char *s, int local)
s = xs_str_cat(s, s1);
if (local) {
- xs *bio = not_really_markdown(xs_dict_get(snac->config, "bio"), NULL);
- xs *s1 = xs_fmt("