mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
Added web UI for [un]bookmarking.
This commit is contained in:
parent
72c31c28ef
commit
67f0efa689
1 changed files with 17 additions and 0 deletions
17
html.c
17
html.c
|
@ -1331,6 +1331,13 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
|
|||
}
|
||||
}
|
||||
|
||||
if (is_bookmarked(snac, id))
|
||||
xs_html_add(form,
|
||||
html_button("unbookmark", L("Unbookmark"), L("Delete this post from your bookmarks")));
|
||||
else
|
||||
xs_html_add(form,
|
||||
html_button("bookmark", L("Bookmark"), L("Add this post to your bookmarks")));
|
||||
|
||||
if (strcmp(actor, snac->actor) != 0) {
|
||||
/* controls for other actors than this one */
|
||||
if (following_check(snac, actor)) {
|
||||
|
@ -3387,6 +3394,16 @@ int html_post_handler(const xs_dict *req, const char *q_path,
|
|||
unpin(&snac, id);
|
||||
timeline_touch(&snac);
|
||||
}
|
||||
else
|
||||
if (strcmp(action, L("Bookmark")) == 0) { /** **/
|
||||
bookmark(&snac, id);
|
||||
timeline_touch(&snac);
|
||||
}
|
||||
else
|
||||
if (strcmp(action, L("Unbookmark")) == 0) { /** **/
|
||||
unbookmark(&snac, id);
|
||||
timeline_touch(&snac);
|
||||
}
|
||||
else
|
||||
status = HTTP_STATUS_NOT_FOUND;
|
||||
|
||||
|
|
Loading…
Reference in a new issue