martinetd / matrirc

irc gateway to matrix
14 stars 2 forks source link

reverse emoji translation (reaction and/or text) #5

Open martinetd opened 1 year ago

martinetd commented 1 year ago

It's be nice to allow sending some common reactions: suggested syntax /regex/ :emoji:

Sounds OK to me if it only works on LRU of recent messages (e.g. since last restart, we wouldn't serialize all messages to disk)

emojis in reaction (ruma_common::events::reaction::ReactionEventContent) seems to just have the glyph in relates_to.key, but it's not practical to input utf-8 emojis in a terminal so having :emoji: aliases would probably be useful. If we do that, might as well do the translation in messages too

snan commented 1 year ago

I use unicode emojis as is on irc from time to time, maybe I should stop doing that if it's not widely supported yet. 🤷🏻‍♀️ For example, ConnectBot on Android didn't support them last I used it (which was in 2021).

martinetd commented 1 year ago

I'm not sure I understand your comment: sending unicode emojis from your IRC client is fine and they'll get sent to matrix as is; as long as folks you talk to have fonts that can display them in their web browser there'll be no problem (and this is usually fine) This isn't always the case with terminals as you pointed out with connectbot -- that's #4 -- we already do lookup emojis from reactions and display both the emoji and its name (so you'll see something like " 🤣 (rolling on the floor laughing)"), but some emojis are missing so it could be improved, and we might also want to do the same conversions in text itself but I'm a bit reluctant to modify text people wrote arbitrarily so this probably won't be done for a while longer.

This issue is the other way around: sending reactions e.g. give a specific message a thumbs up; reactions are also just utf8 characters so if you can input utf8 emojis directly that'll work just as well, but I can't so I suggested matching :foo:, looking it up in some table (currently using the emoji crate which has a lookup_by_name helper) and using that instead as the matrix protocol doesn't handle :foo: itself, it's the sender's job to make that an utf8 glyph.