gotosocial icon indicating copy to clipboard operation
gotosocial copied to clipboard

[feature] unshorten Mastodon-style links

Open mirabilos opened this issue 1 year ago • 2 comments

Is your feature request related to a problem ?

I’m always frustrated when someone just post a hyperlink with no explanation, and the sending side shortens them.

On Semaphore on the laptop, I can hover over it to see the full link, which often contains enough information to spare me from following it, but no chance on mobile.

Describe the solution you'd like.

In a discussion I just found out that the client tut un-shortens those links. I looked at PostgreSQL and they are stored shortened, so that’s something the sending side does (not GtS), not the client.

I would like for GtS to help out the clients, because that can be done easily centrally, e.g. at message ingress.

The change request is to add something like:

For each <a href="FOO" [optional more parameters] >BAR</a> in the incoming status: check whether BAR ends with a number of dots (ideally not just U+002E but also U+2026); if so, let BAZ be BAR without those trailing dots, then test whether FOO begins with BAZ; if so, replace BAR with FOO in the status.

Describe alternatives you've considered.

Asking the client developers to do that. But each client would then need to do that independently, and solving this centrally, while not strictly speaking a server task, would be less total work and more benefit for the users.

Additional context.

The sending side of an exemplary toot with shortened links is Akkoma, in case it helps I can also look up examples, though SELECT id,content FROM statuses WHERE content LIKE '%...</a%' LIMIT 5; on your own instance will likely find some as well (and some false positives).

mirabilos avatar Nov 10 '23 03:11 mirabilos

Oh, I forgot: this is also a low-prio wishlist item, maybe for Hacktoberfest or as a good first contribution or something, if you decide to have it.

mirabilos avatar Nov 10 '23 03:11 mirabilos

Could perhaps also be enabled in the config file, and not just default behavior?

benjaminbhollon avatar Nov 10 '23 03:11 benjaminbhollon