summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2024-05-07 19:40:28 +0200
committerGravatar default2024-05-07 19:40:28 +0200
commit6b1721c977294ee28f54150579c36514aa3ee62a (patch)
tree9ebd8169f90ce7f46485221d4c6b33ea515c8f21 /html.c
parentVersion 2.52 RELEASED. (diff)
downloadsnac2-6b1721c977294ee28f54150579c36514aa3ee62a.tar.gz
snac2-6b1721c977294ee28f54150579c36514aa3ee62a.tar.xz
snac2-6b1721c977294ee28f54150579c36514aa3ee62a.zip
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.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/html.c b/html.c
index ee5c2cd..b34fc81 100644
--- a/html.c
+++ b/html.c
@@ -2658,6 +2658,29 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2658 } 2658 }
2659 } 2659 }
2660 else 2660 else
2661 if (xs_startswith(p_path, "list/")) { /** list timelines **/
2662 if (!login(&snac, req)) {
2663 *body = xs_dup(uid);
2664 status = 401;
2665 }
2666 else {
2667 xs *l = xs_split(p_path, "/");
2668 char *lid = xs_list_get(l, -1);
2669
2670 xs *list = list_timeline(&snac, lid, skip, show);
2671 xs *next = list_timeline(&snac, lid, skip + show, 1);
2672
2673 if (list != NULL) {
2674 xs *base = xs_fmt("/list/%s", lid);
2675
2676 *body = html_timeline(&snac, list, 0, skip, show,
2677 xs_list_len(next), NULL, base, 0);
2678 *b_size = strlen(*body);
2679 status = 200;
2680 }
2681 }
2682 }
2683 else
2661 if (xs_startswith(p_path, "p/")) { /** a timeline with just one entry **/ 2684 if (xs_startswith(p_path, "p/")) { /** a timeline with just one entry **/
2662 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) 2685 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE)
2663 return 403; 2686 return 403;