matrix-appservice-slack icon indicating copy to clipboard operation
matrix-appservice-slack copied to clipboard

Bridged Matrix avatars will not show up if not a PNG/GIF/JPEG

Open Jaykul opened this issue 4 years ago • 11 comments

Describe the bug I'm running a Matrix instance bridged into IRC, Discord and Slack.

  • All users show up fine in Matrix (avatars work from both Discord and Slack)
  • Matrix users show up fine in Slack, with avatars as expected
  • Discord users show up with the bot's default avatar icon (the name changes properly, but they get the default icon)

At first, I thought it was a missconfiguration of the slack bot account/permissions, but I think if that was the case, then the matrix users' avatars wouldn't show up, right?

For what it's worth, I'm running everything via the matrix-docker-ansible-deploy...

Jaykul avatar Mar 12 '21 05:03 Jaykul

All users show up fine in Matrix (avatars work from both Discord and Slack) Matrix users show up fine in Slack, with avatars as expected

I'm confused. What is the problem?

Half-Shot avatar Mar 16 '21 10:03 Half-Shot

I'm reading this as: As a Slack user, I don't see the avatars of Discord users.

jaller94 avatar Mar 16 '21 15:03 jaller94

That's a strange problem. There isn't really a distinction between Matrix avatars and Discord avatars from the Slack perspective.

Half-Shot avatar Apr 07 '21 09:04 Half-Shot

Sorry I haven't been paying attention to emails, but yes, that's what's happening.

For Slack users, only slack users and matrix users have their avatar images loaded properly. Anyone who is double-bridged is showing up with the bot's default icon, so the conversation looks like this a lot (the yellow icon is my bot's default avatar):

image

You can see the last two messages were sent by me:

  • one from Matrix (note the "App" is still there), and it shows my avatar.
  • one from Discord, and it doesn't show my avatar.

I have this set up with Discord, Slack, and IRC all connected -- on the discord side, only the IRC users don't get avatars. On slack, only Matrix users do (well, and Slack users, obviously).

Side note: I really wish the bots would all use https://robohash.org/ or a similar service for users with no icon...

It's a public community, you can see this for yourself if you like ;-)

  • https://poshcode.org/slack
  • https://poshcode.org/discord
  • https://poshcode.org/irc
  • https://matrix.to/#/#bridge:PoshCode.org

Jaykul avatar Apr 09 '21 05:04 Jaykul

Any ideas @Half-Shot?

Jaykul avatar Apr 24 '21 16:04 Jaykul

Quick guess:

  • All Discord avatars seem to be WebP images. Slack may not support WebP as avatars.

jaller94 avatar Apr 25 '21 10:04 jaller94

I guess I've experimentally confirmed this. Not sure what to do about it, unless the bot wants to try converting everything to png for slack -- since that means it can inherently affect anyone, since Matrix / Element does support using webp images as your avatar:

image

If you try to upload a webp as your avatar in Slack, they be like: image

Jaykul avatar May 01 '21 02:05 Jaykul

Tediously, I suspect the best way is to indeed make the bridge convert to PNG. It feels like this could be a concern of the media repo to support clients (and bridges) who cannot display certain media. However, yeah we will need to look at solving this in the short term in the bridge. I'm aware that adding support for this would be potentially tricky though so I don't know how long a solution would take.

Half-Shot avatar May 01 '21 12:05 Half-Shot

How's that going, @jaller94?

You know, to avoid the dependency on convert, you could always ship your own binary 🤨 -- at least, that's what /scionoftech/webp-converter does...

Jaykul avatar May 30 '21 02:05 Jaykul

@Half-Shot

Maybe I'm missing something, can't you just url-rewrite the .webp to .png for slack? Without any transcoding? The api lets you choose filetype

For example, these both work.

All CDNs support at least .png. Most have more.

https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints

ninmonkey avatar May 31 '21 06:05 ninmonkey

I don't think this bridge will ever see the discord URLs. However (at least in my case), I think the icon is coming from a matrix media server that could also provide whatever media type we wanted. I'm not sure how to make that happen, but I'll look into the configuration.

Jaykul avatar Jun 01 '21 05:06 Jaykul