From f4c7f4b9d79d8430e4d95c9c46a8ab402096d5a3 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 29 Jun 2023 18:06:42 +0200 Subject: [PATCH] Added a new snac-post-header CSS class. --- html.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/html.c b/html.c index 278209a..dfd20e7 100644 --- a/html.c +++ b/html.c @@ -81,7 +81,7 @@ xs_str *actor_name(xs_dict *actor) xs_str *html_actor_icon(xs_str *os, char *actor, const char *date, const char *udate, const char *url, int priv) { - xs *s = xs_str_new("
\n"); + xs *s = xs_str_new(NULL); xs *avatar = NULL; char *v; @@ -169,8 +169,6 @@ xs_str *html_actor_icon(xs_str *os, char *actor, s = xs_str_cat(s, s1); } - s = xs_str_cat(s, "
\n"); - return xs_str_cat(os, s); } @@ -807,14 +805,14 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, } if (strcmp(type, "Follow") == 0) { - s = xs_str_cat(s, "
\n"); + s = xs_str_cat(s, "
\n
\n"); xs *s1 = xs_fmt("
%s
\n", L("follows you")); s = xs_str_cat(s, s1); s = html_msg_icon(snac, s, msg); - s = xs_str_cat(s, "
\n"); + s = xs_str_cat(s, "
\n
\n"); return xs_str_cat(os, s); } @@ -839,7 +837,12 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) return os; - s = xs_str_cat(s, "
"); /** **/ + if (level == 0) + s = xs_str_cat(s, "
\n"); /** **/ + else + s = xs_str_cat(s, "
\n"); /** **/ + + s = xs_str_cat(s, "
\n
"); /** **/ if (is_pinned(snac, id)) { /* add a pin emoji */ @@ -873,11 +876,6 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, s = xs_str_cat(s, "
\n"); - if (level == 0) - s = xs_str_cat(s, "
\n"); /** **/ - else - s = xs_str_cat(s, "
\n"); /** **/ - if (boosts == NULL) boosts = object_announces(id); @@ -934,7 +932,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, s = html_msg_icon(snac, s, msg); /* add the content */ - s = xs_str_cat(s, "
\n"); /** **/ + s = xs_str_cat(s, "
\n
\n"); /** **/ /* is it sensitive? */ if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) {