MUST be pub.versia:likes/Like.
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
Inherited from Entity: id, created_at, updated_at, extensions
idstring Requiredcreated_atRFC3339 Requiredupdated_atRFC3339extensionsExtensions
{
"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
MUST be pub.versia:likes/Dislike.
Inherited from Entity: id, created_at, updated_at, extensions
idstring Requiredcreated_atRFC3339 Requiredupdated_atRFC3339extensionsExtensions
{
"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:
pub.versia:likes/Likes: Reference Collection of all the notes the user has liked.pub.versia:likes/Dislikes: Reference 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: Reference Collection of all the likes the note has received.pub.versia:likes/Dislikes: Reference 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 Notepub.versia:likes/dislike, for disliking a Note