Plume-org / Plume

Federated blogging application, thanks to ActivityPub (now on https://git.joinplu.me/ — this is just a mirror)
https://joinplu.me
GNU Affero General Public License v3.0
2.09k stars 133 forks source link

Display Mastodon/Pleroma emojis #336

Open trinity-1686a opened 5 years ago

trinity-1686a commented 5 years ago

Showing :emojiname: is not exactly beautiful, Plume should try to display theme (this mainly concern display names, as Mastodon/Pleroma send directly html already containing emojis).

Some information for anyone trying to implement this feature : Supported emojis for an instance can be queried at /api/v1/custom_emojis, which return a json looking like that (truncated because it's actually very long):

[
 {
  "shortcode":"thaenkin",
  "static_url":"https://instance.domain/emoji/custom/thaenkin.png",
  "url":"https://instance.domain/emoji/custom/thaenkin.png",
  "visible_in_picker":true},
  ...
]

static_url must be a static image, whereas url can be a gif, so it is probably better to display static_url at least as long as the user is not hovering the picture

Plume version (and/or commit): 0.2

elegaanz commented 5 years ago

Emojos are federated, so I don't think we will have to use the REST API there. They are listed in the tag field, and look like.

{
  "id": "https://example.instance.org/emojis/26312",
  "type": "Emoji",
  "name": ":emojo:",
  "updated":"2018-12-03T21:55:00Z",
  "icon": {
    "type": "Image",
     "mediaType": "image/png",
     "url": "https://example.instance.org/path/to/emojo.png"
  }
}