If so, that's pretty cool.

  • wheresmysurplusvalue [comrade/them]
    ·
    edit-2
    1 year ago

    Thanks for the details. It sounds like there are two things the hexbear frontend does to support the old emoji format:

    1. When entering a message, the emoji picker assists in autocorrecting to proper image markdown format.
    2. When displaying a message (post/comment/etc), the hexbear web frontend replaces old-format emoji text with the <img> while generating the html.

    For #1, this is really handy, though it has the limitation that mobile app users of hexbear can't enter proper emojis unless they remember the emoji url. And same for federated users if hexbear federates.

    For #2, if we can identify emojis while displaying the html, could this same thing be done in the Lemmy API that provides the post/comment data to other instances or to mobile apps? By this I mean replace :emoji: stored in the database with ![image](...) format on the fly when we retrieve the data. This would automatically support old posts, federated users, and mobile users in one shot.

    I should just submit a PR but first I'd have to figure out how to get the dev environment working 😂

    Anyway I recognize I'm just splitting hairs and it doesn't matter in the end!

    • Changeling [it/its]
      ·
      edit-2
      1 year ago

      (Edit: To be clear, I’m not a current dev on this project)

      I believe point 1 is custom behavior and point 2 is just a matter of adding a markdown rule but I’m not 100% sure. I believe the emojis repo has a normalized copy of each emoji that could theoretically be downloaded and used like a sticker pack by mobile app users or just uploaded manually, even elsewhere. But an actual sticker pack feature on the app would be a neat and fun feature. As for the thing about showing the legacy emojis to other servers, I’d imagine that involve regex ing every single comment ever sent with a custom list of hard coded emojis and URLs, which is kinda messy, especially for server-to-server federation endpoints

      • wheresmysurplusvalue [comrade/them]
        ·
        1 year ago

        Yeah, good point about it being messy, and I also wonder about performance. But if the hexbear frontend is already doing this text replacement when generating the html, then it must already be a solved problem? Would need to crack open the code to see how it was implemented