aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-01-19 15:53:19 +0100
committergrunfink <grunfink@comam.es>2026-01-19 15:53:19 +0100
commitd8d40acfd17dfe28654f7acfac648a896033b63b (patch)
tree8af870554b76107149c0ded0abe2a71f9a1e3e89
parent4e166a5d22402da864518455c2cd03d6ba5ab41d (diff)
New command-line option 'refresh'.
-rw-r--r--activitypub.c2
-rw-r--r--main.c17
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)
actor_add(actor, actor_o);
}
else {
- if (status == HTTP_STATUS_GONE) {
+ if (status == HTTP_STATUS_GONE || status == HTTP_STATUS_NOT_FOUND) {
actor_failure(actor, 1);
snac_log(user, xs_fmt("actor_refresh marking actor %s as broken %d", actor, status));
}
diff --git a/main.c b/main.c
index 4ba9796..e7d5b0d 100644
--- a/main.c
+++ b/main.c
@@ -77,7 +77,8 @@ int usage(const char *cmd)
"list_remove {basedir} {uid} {name} Removes an existing list\n"
"list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n"
"list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n"
- "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n";
+ "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n"
+ "refresh {basedir} {uid} Refreshes all actors\n";
if (cmd == NULL)
printf("%s", cmds);
@@ -369,6 +370,20 @@ int main(int argc, char *argv[])
return 0;
}
+ if (strcmp(cmd, "refresh") == 0) { /** **/
+ xs *fwers = follower_list(&snac);
+ xs *fwing = following_list(&snac);
+ const char *id;
+
+ xs_list_foreach(fwers, id)
+ enqueue_actor_refresh(&snac, id, 0);
+
+ xs_list_foreach(fwing, id)
+ enqueue_actor_refresh(&snac, id, 0);
+
+ return 0;
+ }
+
if ((url = GET_ARGV()) == NULL)
return usage(cmd);