diff options
| author | default <nobody@localhost> | 2024-12-31 08:06:48 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2024-12-31 08:06:48 +0100 |
| commit | c6fc02efe8520e26eeb5e79c03b7d61ab735d898 (patch) | |
| tree | 7c56ff6ba2202945bca1e48b1f1a8c6ed104bc25 | |
| parent | 066ce9044912cb9aac66dd6b2be4b2300db922bc (diff) | |
Skip enqueue_output() to local users (already served by the local shared-inbox).
| -rw-r--r-- | activitypub.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c index b0d5f01..e3a1f79 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2428,15 +2428,18 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) /* iterate the recipients */ xs_list_foreach(rcpts, actor) { - xs *inbox = get_actor_inbox(actor, 1); + /* local users were served by this_shared_inbox */ + if (!xs_startswith(actor, srv_baseurl)) { + xs *inbox = get_actor_inbox(actor, 1); - if (inbox != NULL) { - /* add to the set and, if it's not there, send message */ - if (xs_set_add(&inboxes, inbox) == 1) - enqueue_output(snac, msg, inbox, 0, 0); + if (inbox != NULL) { + /* add to the set and, if it's not there, send message */ + if (xs_set_add(&inboxes, inbox) == 1) + enqueue_output(snac, msg, inbox, 0, 0); + } + else + snac_log(snac, xs_fmt("cannot find inbox for %s", actor)); } - else - snac_log(snac, xs_fmt("cannot find inbox for %s", actor)); } /* if it's a public note or question, send to the collected inboxes */ |