snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 53581361326f6f87a92ea47f03b09dd7b8dea631
parent 1022f6db87ea196630972123601639beb190b4c3
Author: default <nobody@localhost>
Date:   Thu, 29 Aug 2024 07:25:28 +0200

Show bookmarked posts with an emoji.

Diffstat:
Mdata.c | 2+-
Mhtml.c | 8++++++++
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/data.c b/data.c @@ -1562,7 +1562,7 @@ int is_muted(snac *snac, const char *actor) int is_bookmarked(snac *user, const char *id) /* returns true if this note is bookmarked */ { - return object_user_cache_in(user, "bookmark", id); + return object_user_cache_in(user, id, "bookmark"); } diff --git a/html.c b/html.c @@ -1523,6 +1523,14 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_html_raw(" &#128204; "))); } + if (user && is_bookmarked(user, id)) { + /* add a bookmark emoji */ + xs_html_add(score, + xs_html_tag("span", + xs_html_attr("title", L("Bookmarked")), + xs_html_raw(" &#128278; "))); + } + if (strcmp(type, "Question") == 0) { /* add the ballot box emoji */ xs_html_add(score,