snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy
Creative Commons Zero v1.0 Universal
727 stars 39 forks source link

Custom Emoji in Fediverse to Bluesky Display Names #1104

Open hybridhavoc opened 5 months ago

hybridhavoc commented 5 months ago

In Mastodon and other Fediverse applications it is possible to include a custom emoji from one's server in the display name. While those applications support this use, Bluesky of course does not. This results in the shortcode for the custom emoji coming over in the display name.

I don't know if this is the best way to handle this exactly, but I wonder if it might be possible, upon Bluesky profile creation / update to strip custom emoji shortcodes from the display name.

snarfed commented 5 months ago

Yes! Agreed, these are awkward. I don't love the idea of removing them, but I don't have a better idea, so we probably should.

snarfed commented 5 months ago

Out of curiosity, what do you think we should do about custom emoji shortcodes in post text? Strip them there too?

qazmlp commented 5 months ago

Out of curiosity, what do you think we should do about custom emoji shortcodes in post text? Strip them there too?

No, definitely keep them, or at most make it a setting if you introduce that at some point.

Even if they don't transfer 'properly' and it looks a bit ugly, having their text representation is still better than removing them silently. I think readers will also generally understand what's happenening because emoji shortcode use is somewhat generally common now thanks to being very discoverable in Discord.

hybridhavoc commented 5 months ago

Out of curiosity, what do you think we should do about custom emoji shortcodes in post text? Strip them there too?

For some reason I'm less inclined to modify the contents of a post. Though I will say that if a post needs to be abbreviated for being too long for Bluesky, it might be preferable to not break in the middle of a short code.

snarfed commented 5 months ago

Interesting! I have to admit, I don't quite get the intuition yet for removing these shortcodes from display names but keeping them in posts. Is it that we think they're more purely decorative in display names, but may have semantic meaning more often in posts?

hybridhavoc commented 5 months ago

Is it that we think they're more purely decorative in display names, but may have semantic meaning more often in posts?

Yes, at least just speaking for myself. I like to sometimes add custom emoji to my display name for decoration in a way that isn't a big deal and isn't intended to communicate much of significance. Whereas an emoji in the body of a post is more likely being used for signifying tone or replacing a word.

It may also be a matter of impact. My display name is seen above every post I make, so having what may come across as gibberish there all the time is more impactful than if it appears in an occasional post.

ygg2 commented 5 months ago

^ Definitely please don't remove the emoji codes! Many users especially on Misskey based software replace words with emojis, so something like https://misskey.io/notes/9te0y2qi2ie7098x (I got locked out of X because of Firefox) would not make sense, and posts like https://misskey.io/notes/9u5m67deo9tk01ee (Goodnight Misskey! See you) would be blank.

snarfed commented 5 months ago

Thanks all!

Next step is implementation. These aren't standardized afaik, and I doubt that all fediverse software with shortcodes uses the same HTML for them (if any). I don't know if I can come up with a regex to find and remove them, even if only from display names, that won't occasionally have false positives and remove other text too. 😕

Tamschi commented 3 weeks ago

Mastodon declares these as "type": "Emoji", "name": ":…:" objects in the "tag": [ … ] array of the Actor, same as on statuses/Notes if I'm not mistaken.

I think you can just search&remove the custom emojis' names from the Actor's name, then trim to remove left-over spaces.