ActivityPub/Primer/Reject activity

From W3C Wiki

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's followers 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 the Follow 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's following 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 -- the Like activity should go into the likes collection, but might not because of filtering rules
  • Announce -- the Announce activity should go into shares collection, but might not because of filtering rule
  • Create with inReplyTo -- the object should go into the replies collection, but again might not because of filtering rules or manual review
  • Add and Remove -- for shared collections
  • Join and Leave -- for a Group (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.

Reference