diff options
| author | 2026-01-19 15:53:19 +0100 | |
|---|---|---|
| committer | 2026-01-19 15:53:19 +0100 | |
| commit | d8d40acfd17dfe28654f7acfac648a896033b63b (patch) | |
| tree | 8af870554b76107149c0ded0abe2a71f9a1e3e89 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-d8d40acfd17dfe28654f7acfac648a896033b63b.tar.gz snac2-d8d40acfd17dfe28654f7acfac648a896033b63b.tar.xz snac2-d8d40acfd17dfe28654f7acfac648a896033b63b.zip | |
New command-line option 'refresh'.
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | main.c | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c index 1992b13..c34e510 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -3395,7 +3395,7 @@ void process_user_queue_item(snac *user, xs_dict *q_item) | |||
| 3395 | actor_add(actor, actor_o); | 3395 | actor_add(actor, actor_o); |
| 3396 | } | 3396 | } |
| 3397 | else { | 3397 | else { |
| 3398 | if (status == HTTP_STATUS_GONE) { | 3398 | if (status == HTTP_STATUS_GONE || status == HTTP_STATUS_NOT_FOUND) { |
| 3399 | actor_failure(actor, 1); | 3399 | actor_failure(actor, 1); |
| 3400 | snac_log(user, xs_fmt("actor_refresh marking actor %s as broken %d", actor, status)); | 3400 | snac_log(user, xs_fmt("actor_refresh marking actor %s as broken %d", actor, status)); |
| 3401 | } | 3401 | } |
| @@ -77,7 +77,8 @@ int usage(const char *cmd) | |||
| 77 | "list_remove {basedir} {uid} {name} Removes an existing list\n" | 77 | "list_remove {basedir} {uid} {name} Removes an existing list\n" |
| 78 | "list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n" | 78 | "list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n" |
| 79 | "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n" | 79 | "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n" |
| 80 | "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n"; | 80 | "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n" |
| 81 | "refresh {basedir} {uid} Refreshes all actors\n"; | ||
| 81 | 82 | ||
| 82 | if (cmd == NULL) | 83 | if (cmd == NULL) |
| 83 | printf("%s", cmds); | 84 | printf("%s", cmds); |
| @@ -369,6 +370,20 @@ int main(int argc, char *argv[]) | |||
| 369 | return 0; | 370 | return 0; |
| 370 | } | 371 | } |
| 371 | 372 | ||
| 373 | if (strcmp(cmd, "refresh") == 0) { /** **/ | ||
| 374 | xs *fwers = follower_list(&snac); | ||
| 375 | xs *fwing = following_list(&snac); | ||
| 376 | const char *id; | ||
| 377 | |||
| 378 | xs_list_foreach(fwers, id) | ||
| 379 | enqueue_actor_refresh(&snac, id, 0); | ||
| 380 | |||
| 381 | xs_list_foreach(fwing, id) | ||
| 382 | enqueue_actor_refresh(&snac, id, 0); | ||
| 383 | |||
| 384 | return 0; | ||
| 385 | } | ||
| 386 | |||
| 372 | if ((url = GET_ARGV()) == NULL) | 387 | if ((url = GET_ARGV()) == NULL) |
| 373 | return usage(cmd); | 388 | return usage(cmd); |
| 374 | 389 | ||