diff options
| author | 2024-08-29 07:25:28 +0200 | |
|---|---|---|
| committer | 2024-08-29 07:25:28 +0200 | |
| commit | 53581361326f6f87a92ea47f03b09dd7b8dea631 (patch) | |
| tree | 18b652748bfebbe67ad1aa41df61ea3c2105c702 | |
| parent | Bookmarking can be done from the command line. (diff) | |
| download | snac2-53581361326f6f87a92ea47f03b09dd7b8dea631.tar.gz snac2-53581361326f6f87a92ea47f03b09dd7b8dea631.tar.xz snac2-53581361326f6f87a92ea47f03b09dd7b8dea631.zip | |
Show bookmarked posts with an emoji.
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | html.c | 8 |
2 files changed, 9 insertions, 1 deletions
| @@ -1562,7 +1562,7 @@ int is_muted(snac *snac, const char *actor) | |||
| 1562 | int is_bookmarked(snac *user, const char *id) | 1562 | int is_bookmarked(snac *user, const char *id) |
| 1563 | /* returns true if this note is bookmarked */ | 1563 | /* returns true if this note is bookmarked */ |
| 1564 | { | 1564 | { |
| 1565 | return object_user_cache_in(user, "bookmark", id); | 1565 | return object_user_cache_in(user, id, "bookmark"); |
| 1566 | } | 1566 | } |
| 1567 | 1567 | ||
| 1568 | 1568 | ||
| @@ -1523,6 +1523,14 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1523 | xs_html_raw(" 📌 "))); | 1523 | xs_html_raw(" 📌 "))); |
| 1524 | } | 1524 | } |
| 1525 | 1525 | ||
| 1526 | if (user && is_bookmarked(user, id)) { | ||
| 1527 | /* add a bookmark emoji */ | ||
| 1528 | xs_html_add(score, | ||
| 1529 | xs_html_tag("span", | ||
| 1530 | xs_html_attr("title", L("Bookmarked")), | ||
| 1531 | xs_html_raw(" 🔖 "))); | ||
| 1532 | } | ||
| 1533 | |||
| 1526 | if (strcmp(type, "Question") == 0) { | 1534 | if (strcmp(type, "Question") == 0) { |
| 1527 | /* add the ballot box emoji */ | 1535 | /* add the ballot box emoji */ |
| 1528 | xs_html_add(score, | 1536 | xs_html_add(score, |