sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
291 stars 27 forks source link

Global emotes not replaced in direct messages #143

Closed dgw closed 6 years ago

dgw commented 6 years ago

On Discord, global emotes work in direct message conversations. People can send them to you, just like they can send global emoji to channels in any random server.

bitlbee-discord doesn't parse them to image links, though. The default Discord emoji I've seen come through in PMs work just fine (they appear as your standard Unicode emoji characters).

It looks like the message prep steps including custom emoji parsing are skipped if cinfo->type == CHANNEL_PRIVATE. Is that working around something, an optimization, or both? Obviously mentioning roles, channels, and other users probably won't work as expected in PMs so there's no need to parse those, but if I got off my duff and made a patch to parse emoji no matter what would it be welcome? (Along with #139, this would probably be reason to shove emoji parsing into its own reusable function. In this case, because of code duplication; in #139's, because of added code complexity in the message prepare function.)

sm00th commented 6 years ago

It looks like the message prep steps including custom emoji parsing are skipped if cinfo->type == CHANNEL_PRIVATE. Is that working around something, an optimization, or both?

I believe that at the time there either were no global emojis, or I had no knowledge of them, I don't think it is a workaround.

if I got off my duff and made a patch to parse emoji no matter what would it be welcome?

Of course it would, just make sure that it works both ways before posting, all other potential problems we will figure out during review.

dgw commented 6 years ago

I'll add this to my list of stuff to work on. By "works both ways" you mean both in PMs and in channels, or something else? I haven't even thought about how outbound global emote translation might work yet…

sm00th commented 6 years ago

By "works both ways" you mean both in PMs and in channels, or something else?

Yes, I meant that it shouldn't break existing functionality accidentally. Outgoing translations is a whole different topic.