From ef7b66697f5b3261a451917d2996563a141df68a Mon Sep 17 00:00:00 2001 From: grunfink Date: Wed, 24 Jun 2026 14:54:45 +0200 Subject: Implemented semi-random forward_secs in enqueue_object_request() or enqueue_actor_refresh(). If forward_secs is a negative value in these functions, it's used as the modulo of a hash of the user id. This way, a refresh storm of the same object by all users is somewhat distributed in time. --- activitypub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index e9be2de..514e764 100644 --- a/activitypub.c +++ b/activitypub.c @@ -3077,7 +3077,7 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req) else { /* actor / key mismatch: don't accept blindly, but request an actor update from the original source, as the Update may come from a relay and be legit */ - enqueue_actor_refresh(snac, actor, 0); + enqueue_actor_refresh(snac, actor, -10); snac_log(snac, xs_fmt("Update: mismatched actor '%s' and key '%s'", actor, key_id)); } @@ -3097,7 +3097,7 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req) else if (strcmp(atto, key_id) != 0) { /* actor / key mismatch: request the object from the original source */ - enqueue_object_request(snac, id, 0); + enqueue_object_request(snac, id, -10); snac_log(snac, xs_fmt("Update: mismatched attributedTo '%s' and key '%s'", atto, key_id)); } -- cgit