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
objectof the activity exists.
If the object is an activity of type Follow, the server should also check:
- That the
objectof the Follow activity is not already in the actor'sfollowerscollection. - That the Follow activity has not been undone by an
Undoactivity. See ActivityPub/Primer/Undo activity for more information.
If these checks pass, then the server should:
- Send the
Rejectactivity to the actor of theFollowactivity.
Server to server
When a server receives an Reject activity from a remote user, it should check:
- That the
objectof the activity exists.
If the object is an activity of type Follow, the server should also check:
- That the
actorof the Accept activity is not already in the recipient'sfollowingcollection. - That the Follow activity has not been undone by an
Undoactivity. 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-- theLikeactivity should go into thelikescollection, but might not because of filtering rulesAnnounce-- theAnnounceactivity should go intosharescollection, but might not because of filtering ruleCreatewithinReplyTo-- theobjectshould go into therepliescollection, but again might not because of filtering rules or manual reviewAddandRemove-- for shared collectionsJoinandLeave-- 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.