ActivityPub/Primer/Accept activity
Appearance
< ActivityPub | Primer
The Accept activity is how an actor expresses their approval for another activity, typically. In ActivityPub, it is especially important for accepting Follow activities.
Client to server
When a server receives an Accept activity, 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:
- Add the
actorof the Follow activity to theactorof the Accept activity'sfollowers. - If it's a local user, add the
actorof the Accept activity to theactorof the Accept activity'sfollowing. If not, it may make sense to retain this information if the server is keeping a cache of the following collections of remote users. - Send the
Acceptactivity to the actor of theFollowactivity.
Server to server
When a server receives an Accept 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.
If these checks pass, then the server should:
- Add the
actorof the Accept activity to theactorof the Follow activity'sfollowing. - If the server is keeping caches of remote
followerscollects, add theactorof the Follow activity to theactorof the Accept activity'sfollowing.
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.