From d3309f8b5e43c8116f99e548bb9f874b5cdaf70e Mon Sep 17 00:00:00 2001 From: violette Date: Thu, 21 May 2026 19:40:58 +0200 Subject: Added a new 'admiration' timeline. --- html.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'html.c') diff --git a/html.c b/html.c index cd1746a..29dd8e8 100644 --- a/html.c +++ b/html.c @@ -3520,6 +3520,18 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, xs_html_text(L("pinned"))))); } + { + /* show the list of bookmarked posts */ + xs *url = xs_fmt("%s/admirations", user->actor); + xs_html_add(lol, + xs_html_tag("li", + xs_html_tag("a", + xs_html_attr("href", url), + xs_html_attr("class", "snac-list-link"), + xs_html_attr("title", L("Liked, boosted or reacted posts")), + xs_html_text(L("admirations"))))); + } + { /* show the list of bookmarked posts */ xs *url = xs_fmt("%s/bookmarks", user->actor); @@ -5042,6 +5054,22 @@ int html_get_handler(const xs_dict *req, const char *q_path, } } else + if (strcmp(p_path, "admirations") == 0) { /** list of admired posts **/ + if (!login(&snac, req)) { + *body = xs_dup(uid); + status = HTTP_STATUS_UNAUTHORIZED; + } + else { + int more = 0; + xs *list = timeline_list(&snac, "admire", skip, show, &more); + + *body = html_timeline(&snac, list, 0, skip, show, + more, L("Liked, boosted or reacted posts"), "/admirations", 0, error, terse); + *b_size = strlen(*body); + status = HTTP_STATUS_OK; + } + } + else if (strcmp(p_path, "bookmarks") == 0) { /** list of bookmarked posts **/ if (!login(&snac, req)) { *body = xs_dup(uid); -- cgit