diff options
| author | Ruben Beltran del Rio <rbdr@bravo-i.local> | 2026-04-15 17:17:14 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <rbdr@bravo-i.local> | 2026-04-15 17:17:14 +0200 |
| commit | 30849656518854f1ff5af2ad8e583ceb199d1fbd (patch) | |
| tree | db4d9d12270339df74cc2f3941ab8c5341098a70 /html.c | |
| parent | 6fc748933ad263ba0e8c78eb9ae1e085a2b0dfb2 (diff) | |
Make neighborhood private
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 39 |
1 files changed, 24 insertions, 15 deletions
@@ -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)) { |