diff options
| -rw-r--r-- | html.c | 24 |
1 files changed, 23 insertions, 1 deletions
| @@ -698,6 +698,8 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 698 | xs *admin_url = xs_fmt("%s/admin", user->actor); | 698 | xs *admin_url = xs_fmt("%s/admin", user->actor); |
| 699 | xs *notify_url = xs_fmt("%s/notifications", user->actor); | 699 | xs *notify_url = xs_fmt("%s/notifications", user->actor); |
| 700 | xs *people_url = xs_fmt("%s/people", user->actor); | 700 | xs *people_url = xs_fmt("%s/people", user->actor); |
| 701 | xs *instance_url = xs_fmt("%s/instance", user->actor); | ||
| 702 | |||
| 701 | xs_html_add(top_nav, | 703 | xs_html_add(top_nav, |
| 702 | xs_html_tag("a", | 704 | xs_html_tag("a", |
| 703 | xs_html_attr("href", user->actor), | 705 | xs_html_attr("href", user->actor), |
| @@ -714,7 +716,11 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 714 | xs_html_text(" - "), | 716 | xs_html_text(" - "), |
| 715 | xs_html_tag("a", | 717 | xs_html_tag("a", |
| 716 | xs_html_attr("href", people_url), | 718 | xs_html_attr("href", people_url), |
| 717 | xs_html_text(L("people")))); | 719 | xs_html_text(L("people"))), |
| 720 | xs_html_text(" - "), | ||
| 721 | xs_html_tag("a", | ||
| 722 | xs_html_attr("href", instance_url), | ||
| 723 | xs_html_text(L("instance")))); | ||
| 718 | } | 724 | } |
| 719 | 725 | ||
| 720 | xs_html_add(body, | 726 | xs_html_add(body, |
| @@ -1962,6 +1968,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 1962 | } | 1968 | } |
| 1963 | 1969 | ||
| 1964 | if (list && user && read_only) { | 1970 | if (list && user && read_only) { |
| 1971 | /** history **/ | ||
| 1965 | if (xs_type(xs_dict_get(srv_config, "disable_history")) != XSTYPE_TRUE) { | 1972 | if (xs_type(xs_dict_get(srv_config, "disable_history")) != XSTYPE_TRUE) { |
| 1966 | xs_html *ul = xs_html_tag("ul", NULL); | 1973 | xs_html *ul = xs_html_tag("ul", NULL); |
| 1967 | 1974 | ||
| @@ -2495,6 +2502,21 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 2495 | } | 2502 | } |
| 2496 | } | 2503 | } |
| 2497 | else | 2504 | else |
| 2505 | if (strcmp(p_path, "instance") == 0) { /** instance timeline **/ | ||
| 2506 | if (!login(&snac, req)) { | ||
| 2507 | *body = xs_dup(uid); | ||
| 2508 | status = 401; | ||
| 2509 | } | ||
| 2510 | else { | ||
| 2511 | xs *list = timeline_instance_list(skip, show); | ||
| 2512 | xs *next = timeline_instance_list(skip + show, 1); | ||
| 2513 | |||
| 2514 | *body = html_timeline(&snac, list, 0, skip, show, xs_list_len(next), NULL, "/instance"); | ||
| 2515 | *b_size = strlen(*body); | ||
| 2516 | status = 200; | ||
| 2517 | } | ||
| 2518 | } | ||
| 2519 | else | ||
| 2498 | if (xs_startswith(p_path, "p/")) { /** a timeline with just one entry **/ | 2520 | if (xs_startswith(p_path, "p/")) { /** a timeline with just one entry **/ |
| 2499 | if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) | 2521 | if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) |
| 2500 | return 403; | 2522 | return 403; |