Representing things in a VKontakte/Facebook-style social network?

Oh, my mistake, I thought you were talking about events. I don’t know if there’s any appropriate property for group membership.

I don’t think it’s actually an optimization though? It introduces an entirely unnecessary level of complexity—you have to fetch some ‘global’ information about the server separately, keep track of it, keep it up to date, etc etc. As opposed to just fetching a simple property on the actor object and keeping it right in the accounts row where you’re going to be using it. Like I said, it also goes against the fundamental design of ActivityPub—there’s nothing about the protocol that requires actors on the same server to all be using the same software, especially when it comes to things like c2s clients that may vary wildly across users on the same s2s server!

What I decided to do ultimately:

  • supportsFriendRequests is now a field in the actor object (with my own namespace), as @nightpool suggested. I figured that I can add a flags field to my users table and now I have space for 63 more flags (yay future-proofing, migrating DB schemas is painful).
  • Sending a friend request sends Follow and Offer{Follow}. If there’s a message in the friend request, it’s put into content of Offer.
  • Accepting a friend request simply sends Follow that has a side effect of deleting the pending outgoing friend request on the receiving instance. Accept{Offer{Follow}} feels redundant so I decided against that.
  • Rejecting a friend request sends Reject{Offer{Follow}}.

Wall post addressing.

  • Own posts on own wall work exactly like Mastodon toots.
  • Posts on someone else’s wall use this in their fields:
    "to": [], "cc": ["as:Public", "https://friends.grishka.me/users/1"]
    Notice that there are no followers collections. Public is in cc because otherwise Mastodon would show that post in public feeds.

I only support public posts now, so if I receive a post that doesn’t contain as:Public in either to or cc, I return 400 Bad Request.

It would still be a good idea to send this. You can’t assume that side effects will always be processed exactly as you assume

Regarding 4) Commented/Quoted Post see also