commit 5358136

default  ·  2024-08-29 05:25:28 +0000 UTC
parent 1022f6d
Show bookmarked posts with an emoji.
2 files changed,  +9, -1
M data.c
M html.c
M data.c
+1, -1
1@@ -1562,7 +1562,7 @@ int is_muted(snac *snac, const char *actor)
2 int is_bookmarked(snac *user, const char *id)
3 /* returns true if this note is bookmarked */
4 {
5-    return object_user_cache_in(user, "bookmark", id);
6+    return object_user_cache_in(user, id, "bookmark");
7 }
8 
9 
M html.c
+8, -0
 1@@ -1523,6 +1523,14 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
 2                 xs_html_raw(" 📌 ")));
 3     }
 4 
 5+    if (user && is_bookmarked(user, id)) {
 6+        /* add a bookmark emoji */
 7+        xs_html_add(score,
 8+            xs_html_tag("span",
 9+                xs_html_attr("title", L("Bookmarked")),
10+                xs_html_raw(" 🔖 ")));
11+    }
12+
13     if (strcmp(type, "Question") == 0) {
14         /* add the ballot box emoji */
15         xs_html_add(score,