diff options
| author | grunfink <grunfink@comam.es> | 2025-11-09 16:49:35 +0100 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2025-11-09 16:49:35 +0100 |
| commit | 64b2bd77507fe2e28f19eed382cd41a187a25fe1 (patch) | |
| tree | a5b25483d0b7854e4b64dce2596d011a92bcd35d /activitypub.c | |
| parent | 59d5a8b4a8610c727255d46802e54f216cc9bd90 (diff) | |
Retrieve quoted posts when a post arrives.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index 0368ac8..f1c8783 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2686,6 +2686,19 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req) timeline_request(snac, &in_reply_to, &wrk, 0); + const char *quoted_id = xs_dict_get(object, "quote"); + if (xs_is_string(quoted_id) && xs_match(quoted_id, "https://*|http://*")) { /** **/ + xs *quoted_post = NULL; + int status; + + if (valid_status(status = activitypub_request(snac, quoted_id, "ed_post))) { + /* got quoted post */ + object_add(quoted_id, quoted_post); + } + + snac_debug(snac, 1, xs_fmt("retrieving quoted post %s %d", quoted_id, status)); + } + if (timeline_add(snac, id, object)) { snac_log(snac, xs_fmt("new '%s' %s %s", utype, actor, id)); do_notify = 1; |