aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-09-14 00:50:46 +0200
committergrunfink <grunfink@comam.es>2025-09-14 00:50:46 +0200
commit2656f69d7c7c178fba4b1eb7941771d5b97924e2 (patch)
treec27d72cccc6f515ff68a3dc775dec3bab4be6b27
parent9eb2f672f9b1d26559c2f83596e8d80a352d7611 (diff)
More work in replies pages.
-rw-r--r--activitypub.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 05c3fb1..0bf4379 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -3502,6 +3502,8 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
p_path = xs_list_get(l, 2);
+ const xs_dict *q_vars = xs_dict_get(req, "q_vars");
+
*ctype = "application/activity+json";
int show_contact_metrics = xs_is_true(xs_dict_get(snac.config, "show_contact_metrics"));
@@ -3595,7 +3597,15 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
if (!is_msg_public(obj))
status = HTTP_STATUS_NOT_FOUND;
else
+ if (xs_dict_get(q_vars, "page"))
msg = msg_replies(&snac, id, 1);
+ else {
+ const xs_dict *replies = xs_dict_get(obj, "replies");
+ if (xs_is_dict(replies)) {
+ msg = xs_dup(replies);
+ msg = xs_dict_set(msg, "@context", "https:/""/www.w3.org/ns/activitystreams");
+ }
+ }
}
else
status = HTTP_STATUS_NOT_FOUND;