diff options
author | default <nobody@localhost> | 2024-05-07 19:40:28 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-05-07 19:40:28 +0200 |
commit | 6b1721c977294ee28f54150579c36514aa3ee62a (patch) | |
tree | 9ebd8169f90ce7f46485221d4c6b33ea515c8f21 /html.c | |
parent | c5ae10af862d3c76c79e848fc4dbe69f80cfc214 (diff) |
List timelines can now be (manually) navigated from the web UI.
URLs are {srv_baseurl}/{user}/list/{list_id} (you must know the list id).
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -2658,6 +2658,29 @@ int html_get_handler(const xs_dict *req, const char *q_path, } } else + if (xs_startswith(p_path, "list/")) { /** list timelines **/ + if (!login(&snac, req)) { + *body = xs_dup(uid); + status = 401; + } + else { + xs *l = xs_split(p_path, "/"); + char *lid = xs_list_get(l, -1); + + xs *list = list_timeline(&snac, lid, skip, show); + xs *next = list_timeline(&snac, lid, skip + show, 1); + + if (list != NULL) { + xs *base = xs_fmt("/list/%s", lid); + + *body = html_timeline(&snac, list, 0, skip, show, + xs_list_len(next), NULL, base, 0); + *b_size = strlen(*body); + status = 200; + } + } + } + else if (xs_startswith(p_path, "p/")) { /** a timeline with just one entry **/ if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) return 403; |