Likes Extension

The Likes extension adds support for users to like and dislike notes.

Implementations should make sure that users cannot like and dislike the same note at the same time. If a user dislikes a note they have already liked, the like should be removed, and vice versa.

Likes

Likes are a way for users to show appreciation for a note, like Twitter's "heart" button or Reddit's "upvote".

Entity Definition

  • Name
    type
    Required
    Required
    Type
    string
    Description

    Must be pub.versia:likes/Like.

  • Name
    author
    Required
    Required
    Type
    Reference
    Description

    Reference to the creator of the Like.

  • Name
    liked
    Required
    Required
    Type
    Reference
    Description

    Reference to the note being liked.

Example Like

{
    "id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
    "type": "pub.versia:likes/Like",
    "created_at": "2021-01-01T00:00:00.000Z",
    "author": "6e0204a2-746c-4972-8602-c4f37fc63bbe",
    "liked": "otherexample.org:fmKZ763jzIU8"
}

Dislikes

Dislikes are a way for users to show disapproval for a note, like YouTube's "dislikes" or Reddit's "downvotes".

Entity Definition

  • Name
    type
    Required
    Required
    Type
    string
    Description

    Must be pub.versia:likes/Dislike.

  • Name
    author
    Required
    Required
    Type
    Reference
    Description

    Reference to the creator of the Dislike.

  • Name
    disliked
    Required
    Required
    Type
    Reference
    Description

    Reference to the note being disliked.

Example Dislike

{
    "id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
    "type": "pub.versia:likes/Dislike",
    "created_at": "2021-01-01T00:00:00.000Z",
    "author": "6e0204a2-746c-4972-8602-c4f37fc63bbe",
    "disliked": "otherexample.org:fmKZ763jzIU8"
}

Undoing Likes and Dislikes

To undo a like or dislike, a Delete entity should be used. The deleted property of the Delete entity should link to the Like or Dislike entity to be removed.

User Collections

The Likes extension adds the following collections to the User entity:

  • pub.versia:likes/Likes: URI Collection of all the notes the user has liked.
  • pub.versia:likes/Dislikes: URI Collection of all the notes the user has disliked.

Note Collections

The Likes extension adds the following collections to the Note entity:

  • pub.versia:likes/Likes: URI Collection of all the likes the note has received.
  • pub.versia:likes/Dislikes: URI Collection of all the dislikes the note has received.

Interaction Types

This extension registers the following interaction types:

  • pub.versia:likes#Like, for liking a Note
  • pub.versia:likes#Dislike, for disliking a Note