Unverified Commit 6769fd7a authored by Hong Minhee's avatar Hong Minhee
Browse files

Adjust docs on same-server recipients

parent e3232eb6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@
    "superproperty",
    "supertypes",
    "tempserver",
    "twoslash",
    "typeof",
    "unfollow",
    "unfollowed",
+10 −4
Original line number Diff line number Diff line
@@ -253,10 +253,16 @@ Excluding same-server recipients

*This API is available since Fedify 0.9.0.*

In most cases, you will not want to deliver activities via ActivityPub to
recipients on the same server with the sender.  To exclude same-server
recipients, you can pass the `excludeBaseUris` option to the
`~Context.sendActivity()` method:
Usually, you don't want to send messages through ActivityPub to followers on
the same server because they share the same database, so there's no need to.

For example, if *@foo@example.com* creates a post, it's already stored in
the database at *example.com*, so there's no need to send a `Create(Note)`
activity to *@bar@example.com*, because *@bar@example.com* already has access
to the post in the database.

To exclude same-server recipients, you can pass the `excludeBaseUris` option
to the `~Context.sendActivity()` method:

~~~~ typescript twoslash
import { Activity, type Context } from "@fedify/fedify";