From 30849656518854f1ff5af2ad8e583ceb199d1fbd Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Wed, 15 Apr 2026 17:17:14 +0200 Subject: Make neighborhood private --- html.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 4484fc2..004aa46 100644 --- a/html.c +++ b/html.c @@ -1015,20 +1015,6 @@ static xs_html *html_instance_body(void) xs_html_text(handle))))); } - /* BEGIN neighborhood */ - if (xs_type(xs_dict_get(srv_config, "neighborhood")) == XSTYPE_LIST) { - xs *nurl = xs_fmt("%s/neighborhood", srv_baseurl); - xs_html_add(dl, - xs_html_tag("di", - xs_html_tag("dt", - xs_html_text(L("Neighborhood"))), - xs_html_tag("dd", - xs_html_tag("a", - xs_html_attr("href", nurl), - xs_html_text(L("View federated neighborhood feed")))))); - } - /* END neighborhood */ - return body; } @@ -1224,7 +1210,7 @@ static xs_html *html_user_body(snac *user, int read_only) /* BEGIN neighborhood */ xs_html *neighborhood_nav = xs_html_text(""); if (xs_type(xs_dict_get(srv_config, "neighborhood")) == XSTYPE_LIST) { - xs *nurl = xs_fmt("%s/neighborhood", srv_baseurl); + xs *nurl = xs_fmt("%s/neighborhood", user->actor); neighborhood_nav = xs_html_container( xs_html_text(" - "), xs_html_tag("a", @@ -5049,6 +5035,29 @@ int html_get_handler(const xs_dict *req, const char *q_path, status = HTTP_STATUS_OK; } } + /* BEGIN neighborhood */ + else + if (strcmp(p_path, "neighborhood") == 0) { /** neighborhood timeline **/ + if (xs_type(xs_dict_get(srv_config, "neighborhood")) != XSTYPE_LIST) { + *body = xs_dup(uid); + status = HTTP_STATUS_NOT_FOUND; + } + else + if (!login(&snac, req)) { + *body = xs_dup(uid); + status = HTTP_STATUS_UNAUTHORIZED; + } + else { + xs *list = timeline_neighborhood_list(skip, show); + xs *next = timeline_neighborhood_list(skip + show, 1); + + *body = html_timeline(&snac, list, 0, skip, show, + xs_list_len(next), L("Showing neighborhood timeline"), "/neighborhood", 0, error, terse); + *b_size = strlen(*body); + status = HTTP_STATUS_OK; + } + } + /* END neighborhood */ else if (strcmp(p_path, "pinned") == 0) { /** list of pinned posts **/ if (!login(&snac, req)) { -- cgit