aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Beltran del Rio <rbdr@bravo-i.local>2026-04-15 17:17:14 +0200
committerRuben Beltran del Rio <rbdr@bravo-i.local>2026-04-15 17:17:14 +0200
commit30849656518854f1ff5af2ad8e583ceb199d1fbd (patch)
treedb4d9d12270339df74cc2f3941ab8c5341098a70
parent6fc748933ad263ba0e8c78eb9ae1e085a2b0dfb2 (diff)
Make neighborhood private
-rw-r--r--html.c39
-rw-r--r--httpd.c12
2 files changed, 24 insertions, 27 deletions
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)) {
diff --git a/httpd.c b/httpd.c
index b79aa87..248f5fa 100644
--- a/httpd.c
+++ b/httpd.c
@@ -280,18 +280,6 @@ int server_get_handler(xs_dict *req, const char *q_path,
*body = xs_base64_dec(default_avatar_base64(), b_size);
*ctype = "image/png";
}
- /* BEGIN neighborhood */
- else
- if (strcmp(q_path, "/neighborhood") == 0) {
- if (xs_type(xs_dict_get(srv_config, "neighborhood")) == XSTYPE_LIST) {
- xs *tl = timeline_neighborhood_list(0, 30);
- *body = html_timeline(NULL, tl, 0, 0, 0, 0,
- L("Neighborhood"), NULL, 0, NULL, 0);
- if (*body)
- status = HTTP_STATUS_OK;
- }
- }
- /* END neighborhood */
else
if (strcmp(q_path, "/.well-known/nodeinfo") == 0) {
status = HTTP_STATUS_OK;