Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fedibird emoji reaction #3029

Open
shuuji3 opened this issue Oct 29, 2024 · 4 comments · May be fixed by #3033
Open

Support fedibird emoji reaction #3029

shuuji3 opened this issue Oct 29, 2024 · 4 comments · May be fixed by #3033
Assignees
Labels
c: feature Request for new feature c: fediverse Related to non-Mastodon servers

Comments

@shuuji3
Copy link
Member

shuuji3 commented Oct 29, 2024

Some Mastodon-fork or other Fediverse servers support Emoji reactions but Elk cannot show any of them now.

Although the full support for non-Mastodon feature from Masto.js is still under discussion (neet/masto.js#939), Phanpy already partially supports it (read-only for now). And the required data is already in the API response. The following example is the response used in Elk from Mastodon-fork server (fedibird.com):

{
    ...
    "url": "https://fedibird.com/@shuuji3/113389571124564820",
    ...
    "emojis": [
        {
            "shortcode": "fedibird_role_01",
            "url": "https://files.mastodon.social/cache/custom_emojis/images/000/742/119/original/2fa7c5a158722c9d.png",
            "static_url": "https://files.mastodon.social/cache/custom_emojis/images/000/742/119/static/2fa7c5a158722c9d.png",
            "visible_in_picker": true
        }
    ],
    ...
}

https://mastodon.social/api/v1/statuses/113389571139053725

I think this feature has been there for a long time and is enough stable, so Elk also can support some of them at least as a read-only feature like Phanpy. This will reduce the hurdle of using Elk for users in such servers.

Examples

Original post in Fedibird (Mastodon-fork): https://fedibird.com/@shuuji3/113389571124564820

On Phanpy

screenshot of phanpy showing the post
https://phanpy.social/#/fedibird.com/s/113389571124564820

On Elk

screenshot of elk showing the post
https://main.elk.zone/fedibird.com/@shuuji3/113389571124564820

Other

Useful information on reaction API: cheeaun/phanpy#598 (comment)

@shuuji3 shuuji3 added c: feature Request for new feature c: fediverse Related to non-Mastodon servers labels Oct 29, 2024
@shuuji3 shuuji3 self-assigned this Oct 29, 2024
@shuuji3
Copy link
Member Author

shuuji3 commented Oct 29, 2024

There was a misunderstanding. The above emojis fields only include the emoji information used within the body text, not emoji reactions. So additional data needs to be fetched from another place.

@shuuji3
Copy link
Member Author

shuuji3 commented Oct 29, 2024

The remoji_reactions property can be by fetching the status from the original fedibird server. In this case, it's https://fedibird.com/api/v1/statuses/113389571124564820

{
  "id": "113389571124564820",
  ...
  "url": "https://fedibird.com/@shuuji3/113389571124564820",
  ...
  "emoji_reactions": [
    {
      "name": "fedibird_role_01",
      "count": 1,
      "url": "https://s3.fedibird.com/custom_emojis/images/000/601/889/original/d89c09a74e1ba7b2.png",
      "static_url": "https://s3.fedibird.com/custom_emojis/images/000/601/889/static/d89c09a74e1ba7b2.webp",
      "domain": null,
      "width": 681,
      "height": 111,
      "account_ids": [
        "113389564950996781"
      ],
      "me": true
    },
    {
      "name": "star_02",
      "count": 1,
      "url": "https://s3.fedibird.com/custom_emojis/images/000/601/951/original/1774562bc3456006.gif",
      "static_url": "https://s3.fedibird.com/custom_emojis/images/000/601/951/static/1774562bc3456006.webp",
      "domain": null,
      "width": 672,
      "height": 97,
      "account_ids": [
        "113389564950996781"
      ],
      "me": true
    }
  ],
  "emoji_reactions_count": 2,
  ...
}

@shuuji3 shuuji3 changed the title Support emoji reaction Support fedibird emoji reaction Oct 29, 2024
@noellabo
Copy link

noellabo commented Dec 8, 2024

The emoji_reactions element of the statuses entity included in the REST response contains all the information necessary for display, so it is easy to just display the data.

Reactions are pre-grouped, and accounts with the same reaction are included in account_ids as an array of IDs. If you want to reflect this in the display, request account information that is not yet held from the server.

Note that Fedibird and Mastodon v4.3 and later support bulk get of account information.
https://docs.joinmastodon.org/methods/accounts/#index

@shuuji3
Copy link
Member Author

shuuji3 commented Dec 9, 2024

Thanks @noellabo, this is really helpful information! 🙏🏻

I was motivated to add this feature because I've seen many Fedibird users enjoying communicating with each other using various emojis. Supporting this will help non-Fedibird users feel more included in a shared circle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature c: fediverse Related to non-Mastodon servers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants