Skip to content

Likes Extension

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

This extension requires pub.versia:social@1, which defines Notes.

Definition

Like

Likes are a way for users to show appreciation for a note.

Type
"pub.versia:likes/Like"
Fetch
GET /.versia/v0.7/entities/pub.versia:likes/Like/{id}

Fields

type string Required

MUST be pub.versia:likes/Like.

author Reference Required

Reference to the User who created the Like.

target Reference Required

Reference to the note being liked.

Inherited from Entity: id, created_at, updated_at, extensions
{
    "id": "033gs6adpp000",
    "type": "pub.versia:likes/Like",
    "created_at": "2021-01-01T00:00:00Z",
    "author": "example.com:033wv9k6n0007",
    "target": "example.org:033w19vsgr000"
}

Dislike

Dislikes are a way for users to show disapproval for a note.

Type
"pub.versia:likes/Dislike"
Fetch
GET /.versia/v0.7/entities/pub.versia:likes/Dislike/{id}

Fields

type string Required

MUST be pub.versia:likes/Dislike.

author Reference Required

Reference to the User who created the Dislike.

target Reference Required

Reference to the note being disliked.

Inherited from Entity: id, created_at, updated_at, extensions
{
    "id": "033gs6adpp000",
    "type": "pub.versia:likes/Dislike",
    "created_at": "2021-01-01T00:00:00Z",
    "author": "example.com:033wv9k6n0007",
    "target": "example.org:033w19vsgr000"
}

Behavior

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.

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

Delivery and Access

A sender MUST deliver Likes and Dislikes to the author of the Note and, if the Note is public, to the subscribers of the user who sent them.

Any instance that may fetch the Note, and the instance of the Note’s author, may fetch a Like or Dislike.

Collections

User Collections

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

Note Collections

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

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