commit 64b2bd7
grunfink
·
2025-11-09 15:49:35 +0000 UTC
parent 59d5a8b
Retrieve quoted posts when a post arrives.
1 files changed,
+13,
-0
+13,
-0
1@@ -2686,6 +2686,19 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
2
3 timeline_request(snac, &in_reply_to, &wrk, 0);
4
5+ const char *quoted_id = xs_dict_get(object, "quote");
6+ if (xs_is_string(quoted_id) && xs_match(quoted_id, "https://*|http://*")) { /** **/
7+ xs *quoted_post = NULL;
8+ int status;
9+
10+ if (valid_status(status = activitypub_request(snac, quoted_id, "ed_post))) {
11+ /* got quoted post */
12+ object_add(quoted_id, quoted_post);
13+ }
14+
15+ snac_debug(snac, 1, xs_fmt("retrieving quoted post %s %d", quoted_id, status));
16+ }
17+
18 if (timeline_add(snac, id, object)) {
19 snac_log(snac, xs_fmt("new '%s' %s %s", utype, actor, id));
20 do_notify = 1;