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

Sorry for bumping an old topic, but I’m now at the stage where I’m going to be federating with myself.

I do need federated friend lists because many things in this style of social network revolve around them:

  • Mutual friends are a big one. I want to be able to display mutual friends for any profile you could open. It also makes sense to do that for friend requests. In both these cases the list of mutual friends helps understand the social context. To do this, I need to have a complete friend (mutual following) list of the other user and then intersect them. I could derive that by intersecting following and followers, and I’ll have to do that for Mastodon and such.
  • In groups and events, I’d like to show which friends are there. Doesn’t require any federation trickery as pertains to friends, but, btw, how do I represent the group member list?
  • Same for likes. People tend to be curious and want to know who of their friends liked something.

I’m going to send friend requests (semantically “I ask you to follow me back requests”) as Offer{Relationship} where relationship type is http://purl.org/vocab/relationship/friendOf. I’ll only send that to compatible servers and the UI will change based on this compatibility. A server is compatible if it contains friendRequests in metadata.capabilities in its nodeinfo. I can’t think of a better way of capability negotiation and there’s clearly some needed.

Flow between compatible servers:

  1. A sends B two activities: Follow and Offer{Relationship}
  2. B sends A Accept{Follow} immediately because I don’t implement follower approval
  3. The user on B sees the friend request and accepts it
    3.1. If the user rejects the request, B sends Reject{Offer{Relationship}} and the process ends here, with an unilateral follow
  4. B sends A Accept{Offer{Relationship}} and Follow
  5. A sends B Accept{Follow}
  6. Users are now friends

If the other server doesn’t support friend requests, the flow is exactly like it is between the existing microblogging servers. Follow, then Accept{Follow}, and that’s it.

I’m going to also add a friends collection to my actors, where each object would be like this:

{
    "type": "Relationship",
    "relationship": "http://purl.org/vocab/relationship/friendOf",
    "object": "https://friends.grishka.me/users/1",
    "subject": "https://friends.grishka.me/users/2"
}