summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-09-14 00:50:46 +0200
committerGravatar grunfink2025-09-14 00:50:46 +0200
commit2656f69d7c7c178fba4b1eb7941771d5b97924e2 (patch)
treec27d72cccc6f515ff68a3dc775dec3bab4be6b27 /activitypub.c
parentmastoapi: Fixed incorrect messages in status query. (diff)
downloadpenes-snac2-2656f69d7c7c178fba4b1eb7941771d5b97924e2.tar.gz
penes-snac2-2656f69d7c7c178fba4b1eb7941771d5b97924e2.tar.xz
penes-snac2-2656f69d7c7c178fba4b1eb7941771d5b97924e2.zip
More work in replies pages.
Diffstat (limited to 'activitypub.c')
-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,
3502 3502
3503 p_path = xs_list_get(l, 2); 3503 p_path = xs_list_get(l, 2);
3504 3504
3505 const xs_dict *q_vars = xs_dict_get(req, "q_vars");
3506
3505 *ctype = "application/activity+json"; 3507 *ctype = "application/activity+json";
3506 3508
3507 int show_contact_metrics = xs_is_true(xs_dict_get(snac.config, "show_contact_metrics")); 3509 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,
3595 if (!is_msg_public(obj)) 3597 if (!is_msg_public(obj))
3596 status = HTTP_STATUS_NOT_FOUND; 3598 status = HTTP_STATUS_NOT_FOUND;
3597 else 3599 else
3600 if (xs_dict_get(q_vars, "page"))
3598 msg = msg_replies(&snac, id, 1); 3601 msg = msg_replies(&snac, id, 1);
3602 else {
3603 const xs_dict *replies = xs_dict_get(obj, "replies");
3604 if (xs_is_dict(replies)) {
3605 msg = xs_dup(replies);
3606 msg = xs_dict_set(msg, "@context", "https:/""/www.w3.org/ns/activitystreams");
3607 }
3608 }
3599 } 3609 }
3600 else 3610 else
3601 status = HTTP_STATUS_NOT_FOUND; 3611 status = HTTP_STATUS_NOT_FOUND;