The Block activity, how's that supposed to work?

I’m now at the point where I’m satisfied with my main features and almost ready to make my first release. Though in order to be a feasible fediverse server, I need to implement some sort of user blocking. So here goes.

The spec says that the Block activity is c2s only. Mastodon does send Block and Undo{Block} activities when you block and unblock a remote actor. What am I meant to do upon receipt of these activities? Remove all follow relationships and disallow the blocked actor any interactions with the originating actor and their content? Something else?

(I’m not really a fan of the whole “you see more if you log out” approach most social media implementations out there take, both centralized and not. I won’t be hiding anything publicly viewable if its author blocked you.)

1 Like

You basically have two options:

  • Send a Block to the remote server, and the remote server will interpret it however it wishes (remote-side signaling)
  • Do not send a Block, and simply discard any incoming activities received from the blocked actor (local-side filtering)

The C2S Block is the latter, and this is what was probably intended when the AP spec was being written; however, in reality, S2S Block (the former) is quite prevalent. The general semantics of the S2S Block are the following:

  • Do not allow the blocked actor to follow (it is also implied that the follow relationship should be broken even if an explicit Reject Follow is not sent, although it is probably good practice to do so)
  • Disallow any interactions with the blocker or the blocker’s objects (it is implied that any such interactions will simply be discarded if received[1])

  1. Note that Mastodon e.g. currently doesn’t actually do this – blocked users can still reply and have their reply show up beneath the posts of someone who blocked them, but this is probably a bug; Do not process side effects of incoming activities from blocked users · Issue #10916 · tootsuite/mastodon · GitHub should contain more information about this behavior. ↩︎