From 2656f69d7c7c178fba4b1eb7941771d5b97924e2 Mon Sep 17 00:00:00 2001 From: grunfink Date: Sun, 14 Sep 2025 00:50:46 +0200 Subject: More work in replies pages. --- activitypub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activitypub.c') 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; -- cgit v1.2.3