diff options
| author | 2024-05-11 19:16:54 +0200 | |
|---|---|---|
| committer | 2024-05-11 19:16:54 +0200 | |
| commit | 4d53a7b6f7f45f524313980461f5d2a6ef965949 (patch) | |
| tree | 0341b6146258f89d8488f9e01270d34b412c87c1 /activitypub.c | |
| parent | Updated TODO. (diff) | |
| download | snac2-4d53a7b6f7f45f524313980461f5d2a6ef965949.tar.gz snac2-4d53a7b6f7f45f524313980461f5d2a6ef965949.tar.xz snac2-4d53a7b6f7f45f524313980461f5d2a6ef965949.zip | |
In timeline_request(), call enqueue_actor_request on actor errors.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/activitypub.c b/activitypub.c index 301fd4c..280ac87 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -356,23 +356,27 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level) | |||
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | if (xs_match(type, "Note|Page|Article|Video")) { | 358 | if (xs_match(type, "Note|Page|Article|Video")) { |
| 359 | const char *actor = get_atto(object); | ||
| 360 | |||
| 361 | if (content_check("filter_reject.txt", object)) | 359 | if (content_check("filter_reject.txt", object)) |
| 362 | snac_log(snac, xs_fmt("timeline_request rejected by content %s", nid)); | 360 | snac_log(snac, xs_fmt("timeline_request rejected by content %s", nid)); |
| 363 | else { | 361 | else { |
| 364 | /* request (and drop) the actor for this entry */ | 362 | const char *actor = get_atto(object); |
| 365 | if (!xs_is_null(actor)) | 363 | |
| 366 | actor_request(snac, actor, NULL); | 364 | if (!xs_is_null(actor)) { |
| 365 | /* request (and drop) the actor for this entry */ | ||
| 366 | if (!valid_status(actor_request(snac, actor, NULL))) { | ||
| 367 | /* failed? retry later */ | ||
| 368 | enqueue_actor_refresh(snac, actor, 60); | ||
| 369 | } | ||
| 367 | 370 | ||
| 368 | /* does it have an ancestor? */ | 371 | /* does it have an ancestor? */ |
| 369 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); | 372 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); |
| 370 | 373 | ||
| 371 | /* store */ | 374 | /* store */ |
| 372 | timeline_add(snac, nid, object); | 375 | timeline_add(snac, nid, object); |
| 373 | 376 | ||
| 374 | /* recurse! */ | 377 | /* recurse! */ |
| 375 | timeline_request(snac, &in_reply_to, NULL, level + 1); | 378 | timeline_request(snac, &in_reply_to, NULL, level + 1); |
| 379 | } | ||
| 376 | } | 380 | } |
| 377 | } | 381 | } |
| 378 | } | 382 | } |