diff options
| author | 2024-08-29 07:57:29 +0200 | |
|---|---|---|
| committer | 2024-08-29 07:57:29 +0200 | |
| commit | 67f0efa689b47870554cb5aeb401fa406b958114 (patch) | |
| tree | aef7b569146bef7ea0675a3e430efa6fb0804307 /html.c | |
| parent | Pinned posts are no longer shown in the private timeline. (diff) | |
| download | penes-snac2-67f0efa689b47870554cb5aeb401fa406b958114.tar.gz penes-snac2-67f0efa689b47870554cb5aeb401fa406b958114.tar.xz penes-snac2-67f0efa689b47870554cb5aeb401fa406b958114.zip | |
Added web UI for [un]bookmarking.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 17 |
1 files changed, 17 insertions, 0 deletions
| @@ -1331,6 +1331,13 @@ xs_html *html_entry_controls(snac *snac, const char *actor, | |||
| 1331 | } | 1331 | } |
| 1332 | } | 1332 | } |
| 1333 | 1333 | ||
| 1334 | if (is_bookmarked(snac, id)) | ||
| 1335 | xs_html_add(form, | ||
| 1336 | html_button("unbookmark", L("Unbookmark"), L("Delete this post from your bookmarks"))); | ||
| 1337 | else | ||
| 1338 | xs_html_add(form, | ||
| 1339 | html_button("bookmark", L("Bookmark"), L("Add this post to your bookmarks"))); | ||
| 1340 | |||
| 1334 | if (strcmp(actor, snac->actor) != 0) { | 1341 | if (strcmp(actor, snac->actor) != 0) { |
| 1335 | /* controls for other actors than this one */ | 1342 | /* controls for other actors than this one */ |
| 1336 | if (following_check(snac, actor)) { | 1343 | if (following_check(snac, actor)) { |
| @@ -3388,6 +3395,16 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3388 | timeline_touch(&snac); | 3395 | timeline_touch(&snac); |
| 3389 | } | 3396 | } |
| 3390 | else | 3397 | else |
| 3398 | if (strcmp(action, L("Bookmark")) == 0) { /** **/ | ||
| 3399 | bookmark(&snac, id); | ||
| 3400 | timeline_touch(&snac); | ||
| 3401 | } | ||
| 3402 | else | ||
| 3403 | if (strcmp(action, L("Unbookmark")) == 0) { /** **/ | ||
| 3404 | unbookmark(&snac, id); | ||
| 3405 | timeline_touch(&snac); | ||
| 3406 | } | ||
| 3407 | else | ||
| 3391 | status = HTTP_STATUS_NOT_FOUND; | 3408 | status = HTTP_STATUS_NOT_FOUND; |
| 3392 | 3409 | ||
| 3393 | /* delete the cached timeline */ | 3410 | /* delete the cached timeline */ |