Skip to main content


 
I was sad that Matrix doesn't automatically generate previews when people post links, so I decided to make my bot do it. Then I was sad to find the existing opengraph modules don't seem to work in python 3.7. Then I found this and thought, "Hey, I know that guy" and I was happy.

#matrix #python #opengraph @Jason Robinson 🐍🍻

Image/Photo

Looks like I have a character encoding issue to sort out.

Ha, nice, glad you found it and found it useful! I forked a buggy opengraph library for Socialhome and fixed some bugs and made it Python3 compat.

However, Diaspora does have URL previews. They just need to be turned on in your homeserver configuration since by default they're inactive. See here. Additionally each user can set toggles on / off on them globally OR per room + each room can have a default. So no wonder people are confused about this..

However, ~~Diaspora~~ Matrix does have URL previews. They just need to be turned on in your homeserver configuration since by default they’re inactive.
Aha! I did see those toggles, but I thought it was either broken or referring to some other kind of preview.

I found the settings in homeserver.yaml. I'll try it out.

So @Jason Robinson 🐍🍻: Turning it on in my settings worked, but I'm not sure I understand how that works in a federated context.

Are previews enabled for rooms on my homeserver, or do I see previews from any room, regardless of where it's homed, if I'm logged in to my HS?

So media (including URL previews) is a bit different in Matrix. It's always in context of your homeserver. When someone posts an image, your homeserver will download it and show it to you from your homeserver. Costly, but good for decentralization as images don't die when the remote source dies.

The same is true for url previews. So if you have them enabled you will see them in all rooms, depending on your homeserver and your client settings. Note rooms can also disable them by default but you can switch your own client to always request them from your homeserver.

So Matrix is a bit like Diaspora with Camo pre-installed :)

Got it. Thanks!