ActivityPub/Primer/Reject activity
The Reject
activity is how an actor expresses their disapproval for another activity, typically. In ActivityPub, it is especially important for rejecting Follow
activities.
Client to server
When a server receives an Reject
activity from the client, it should check:
- That the
object
of the activity exists.
If the object
is an activity of type Follow
, the server should also check:
- That the
object
of the Follow activity is not already in the actor'sfollowers
collection. - That the Follow activity has not been undone by an
Undo
activity. See ActivityPub/Primer/Undo activity for more information.
If these checks pass, then the server should:
- Send the
Reject
activity to the actor of theFollow
activity.
Server to server
When a server receives an Reject
activity from a remote user, it should check:
- That the
object
of the activity exists.
If the object
is an activity of type Follow
, the server should also check:
- That the
actor
of the Accept activity is not already in the recipient'sfollowing
collection. - That the Follow activity has not been undone by an
Undo
activity. See ActivityPub/Primer/Undo activity for more information.
It may be useful to store this Reject activity as the result
of the Follow
activity, to show that the follow is no longer outstanding.
Additional uses of Reject
It may make sense in the case where a sender expects some sort of side-effect from an activity to send a Reject
activity if the original activity is not processed. Some examples:
Like
-- theLike
activity should go into thelikes
collection, but might not because of filtering rulesAnnounce
-- theAnnounce
activity should go intoshares
collection, but might not because of filtering ruleCreate
withinReplyTo
-- theobject
should go into thereplies
collection, but again might not because of filtering rules or manual reviewAdd
andRemove
-- for shared collectionsJoin
andLeave
-- for aGroup
(not well defined)
For general delivery of Create
activities, sending Reject
activities for every bad object
may be too noisy -- especially if there's no way for the sending server to know what was wrong with the activity.