module

Ktistec::Recipients

Recipient expansion and partitioning shared by tasks and processors.

Class methods

for_deliver(activity : ActivityPub::Activity, sender : ActivityPub::Actor) : Array(String)

Expands an outbound activity's recipient fields into a sorted, deduplicated list of actor IRIs reachable from this server.

The sender is never included in the output -- actors don't deliver to themselves.

Source
for_receive(activity : ActivityPub::Activity, receiver : ActivityPub::Actor, deliver_to : Array(String) | Nil) : Array(String)

Expands an inbound activity's recipient fields into a sorted, deduplicated list of actor IRIs reachable from this server.

Source
forwarding(activity : ActivityPub::Activity) : Forwarding | Nil

Returns the remote actors an inbound activity must be forwarded to, paired with the local account on whose behalf the transfer is made, or nil if there is nothing to forward.

Reads to and cc only. audience is resolver-only.

Source
local_recipients(activity : ActivityPub::Activity) : Array(Account)

Returns the local accounts an inbound activity implicates.

Recipients come from two sources, unioned: the activity's explicit addressing and the recipient implied by the activity's type.

Source
partition(iris : Enumerable(String)) : Partition

Splits IRIs into local recipients (paired with their Account) and remote recipients.

IRIs that don't resolve to a local actor with an account fall through to the remote bucket.

Source
recipient?(activity : ActivityPub::Activity, receiver : ActivityPub::Actor, deliver_to : Array(String) | Nil) : Bool

Returns true if the receiver is a recipient of the inbound activity.

Source
semantic_recipient?(activity : ActivityPub::Activity, receiver : ActivityPub::Actor) : Bool

Returns true if the receiver is the actor the inbound activity implicates by virtue of its type.

Source

Nested types