commit 2656f69

grunfink  ·  2025-09-13 22:50:46 +0000 UTC
parent 9eb2f67
More work in replies pages.
1 files changed,  +10, -0
+10, -0
 1@@ -3502,6 +3502,8 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
 2 
 3     p_path = xs_list_get(l, 2);
 4 
 5+    const xs_dict *q_vars = xs_dict_get(req, "q_vars");
 6+
 7     *ctype  = "application/activity+json";
 8 
 9     int show_contact_metrics = xs_is_true(xs_dict_get(snac.config, "show_contact_metrics"));
10@@ -3595,7 +3597,15 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
11         if (!is_msg_public(obj))
12             status = HTTP_STATUS_NOT_FOUND;
13         else
14+        if (xs_dict_get(q_vars, "page"))
15             msg = msg_replies(&snac, id, 1);
16+        else {
17+            const xs_dict *replies = xs_dict_get(obj, "replies");
18+            if (xs_is_dict(replies)) {
19+                msg = xs_dup(replies);
20+                msg = xs_dict_set(msg, "@context", "https:/""/www.w3.org/ns/activitystreams");
21+            }
22+        }
23     }
24     else
25         status = HTTP_STATUS_NOT_FOUND;