summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-04 08:48:15 +0100
committerdefault <nobody@localhost>2022-11-04 08:48:15 +0100
commit8b252dab84e45de924fb55ef9a85131769c477bc (patch)
tree273501204f5856753769d0337191bc182f492277 /html.c
parentb6a2abede2725b278366313a3649e081b47e51ea (diff)
New 'Hide' button.
Diffstat (limited to 'html.c')
-rw-r--r--html.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/html.c b/html.c
index afeb5df..53f82cb 100644
--- a/html.c
+++ b/html.c
@@ -435,6 +435,7 @@ d_char *html_entry_controls(snac *snac, d_char *os, char *msg, int num)
s = html_button(s, "mute", L("MUTE"));
}
+ s = html_button(s, "hide", L("Hide"));
s = html_button(s, "delete", L("Delete"));
s = xs_str_cat(s, "</form>\n");
@@ -489,6 +490,12 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
xs *s = xs_str_new(NULL);
+ /* top wrap */
+ if ((v = xs_dict_get(meta, "hidden")) && xs_type(v) == XSTYPE_TRUE)
+ s = xs_str_cat(s, "<div style=\"display: none\">\n");
+ else
+ s = xs_str_cat(s, "<div>\n");
+
if (level == 0) {
xs *s1 = xs_fmt("<a name=\"%d_entry\"></a>\n", *num);
@@ -738,7 +745,7 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
s = xs_str_cat(s, "</div>\n");
}
- s = xs_str_cat(s, "</div>\n");
+ s = xs_str_cat(s, "</div>\n</div>\n");
return xs_str_cat(os, s);
}
@@ -1194,6 +1201,10 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
unmute(&snac, actor);
}
else
+ if (strcmp(action, L("Hide")) == 0) {
+ timeline_hide(&snac, id, 1);
+ }
+ else
if (strcmp(action, L("Follow")) == 0) {
xs *msg = msg_follow(&snac, actor);