Is there a spec somewhere on how Lemmy, Kbin and the rest of the threadiverse use ActivityPub? - eviltoast

It seems to me the basic ActivityPub specification is written from the perspective of Mastodon and Twitter-like fediverse instances.

I assume Lemmy and kbin did extend this with some more objects or at least agreed how to use the existing objects and activities there to model a link aggregator with comments on top of that.

Is there some sort of specification or design document about this somewhere? All I found when googling were some old links that resulted in a 404 and the current Lemmy documentation seems more focussed on users, admins and developers and less on the protocol side of things.

  • terribleplan@lemmy.nrd.li
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    First, it’s worth noting that ActivityPub is built on ActivityStreams which is in turn built on ActivityVocabulary. It is necessary to read all of these to have a full understanding of what the stuff in AP actually means. It is also worth reading up on LDN and JSON-LD as those are also used in the spec.

    I think you are right in AP being a bit more oriented toward social media in the vein of twitter or facebook and less like reddit, but really a lot of it comes down to how an AP implementing server interprets the objects it receives. I’m not sure if anywhere near this level of customization would be possible if everything spoke pure AP (which does have a client-server interface, not just a server-server federation interface) rather than your clients interacting with bespoke “lemmy” or “mastodon” or whatever APIs.

    As far as lemmy goes I think they may have extended the objects a little, as there is a lemmy NS included in results, which is what most implementations including big ones like Mastodon do to introduce new fields (such as content warnings in the case of Mastodon) to things like a Note. Lemmy adds info like postingRestrictedToMods, matrixUserId, and moderators.

    As far as objects:

    • A community is a Group.
    • A post is a Page with an audience of the community and an attributedTo of your user (to the community and special public endpoint).
    • A comment is a Note that is inReplyTo its parent (post or comment), to the special public endpoint and CCing the author of the parent and the community.

    As far as actions, I am less sure because it is less easy to inspect without reading the lemmy code or setting up something to get federated to, but AFAICT:

    • Upvotes and downvotes are Like and Dislike
    • Create is used when you as a user want to make a post in a community
    • Announce is used when a post actually gets made in a community
    • I think Announce is used for other things and might explain some of how comments work as well, as a post seems to live on the community instance but a comment seems to live on your instance.
    • taladar@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Thanks, that was very helpful. I was basically hoping to find a document that covered the second half of your comment.

      I don’t have any concrete plans to work on Lemmy so far but I was thinking about the possibility of tags for posts (especially but not only NSFW ones) and filters that work on those tags. Of course if you can rely on the author to tag everything that would probably just be some new extension to the post object but I was considering the option of something similar to the tag systems on adult image or story hosting sistes or Steam where third parties can add, modify or remove tags/metadata about the content in some way too.

      It sounds to me as if something like that would probably be modelled similar to top-level comments in the AP ecosystem (but of course displayed and used differently).