diff options
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, | |||
| 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; |