…for Glitch draft PR #2221 (not yet merged but deployed by catcatnya.com and wetdry.world, among others) and other implementations that implement it (my ports to Firefish and Iceshrimp).
displaying reactions
status objects now have a reactions field. if present, this will be a list of Mastodon Reaction objects, the same kind used by the existing announcements API. display them the same way you'd display reactions to an instance announcement.
adding and removing reactions
there are two new endpoints: POST /api/v1/statuses/:id/react/:name and POST /api/v1/statuses/:id/unreact/:name. id is a status ID. name can be a Unicode emoji, a local custom emoji shortcode, or a remote custom emoji shortcode (these last look like [email protected]). these endpoints do not take a request body, and return an updated Status object including the reaction changes.
reaction cap
instances have a limit on how many unique reactions you can have to a status. you can find this value in GET /api/v1/instance under .configuration.reactions.max_reactions (and you can use the presence of .configuration.reactions to detect the the reactions API).
if the number of reactions to a status with the me field set to true is equal to max_reactions, you should hide whatever button you use to add a reaction. ignoring the cap will lead to an error (Glitch) or previous reactions being removed (Firefish/Iceshrimp).
reaction notifications
there is now a reaction notification type for when an account reacts to a status. under Firefish and Iceshrimp, this notification type has a reaction field as well as account and status, which is a Reaction object with a count of 1, so that clients can show the actual reaction. this field isn't present under Glitch (yet?).
#MastoDev #FediDev #EmojiReactions #Glitch #GlitchSoc #Firefish #Iceshrimp