Do not fetch link cards for mentioned users#6934
Conversation
8cc5022 to
35effb1
Compare
|
I don't like the idea of making a hacky solution even more hacky but also forcing all app developers to make this subtle adjustment. How about we process the HTML server-side and replace the URI with URL when applicable? To be honest if we start doing server-side processing of that HTML, we're only a few steps away from parsing the HTML into plaintext with demarkated entities... |
|
@Gargron I don't like the idea of rewriting HTML links because you're really rewriting links, as opposed to just adding handlers dynamically in the WebUI. If the URL and URI are different for a reason, this breaks the original status' meaning in some way. |
|
Well... There is a reason the URL property exists in the first place, it's what should be linked to. Imagine an AP implementation that returns only JSON-LD from the |
|
Yes I know, but hear me out: admittedly, that is an edge case, but what if I purposefully link to that JSON-LD-only URL in my toot, for instance to talk about some ActivityPub software? I wouldn't want that link to be rewritten in my back, that would be extremely confusing. |
|
is this the reason some foreign statuses show the user profile as an embed? |
|
@MightyPork that's probably addressed by the last commit, yeah |
|
@MightyPork Mastodon uses microformats rel="mention" to demarkate mention links and conversely skip them when fetching link previews. Other platforms don't do that so their mention links look just like any other links. |
|
can we make a compromise here, and write in an explicit
data-mention-acct="id" attribute?
…On Thu, Mar 29, 2018, 12:42 PM Eugen Rochko ***@***.***> wrote:
@MightyPork <https://github.com/MightyPork> Mastodon uses microformats
rel="mention" to demarkate mention links and conversely skip them when
fetching link previews. Other platforms don't do that so their mention
links look just like any other links.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6934 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAORVyPBXdWYlIOkyDHXFKFDWCe0lWsqks5tjQ8QgaJpZM4S9SSt>
.
|
|
@Gargron actually, Mastodon uses CSS classes “u-url” and “mention”, and skips prefetching for links with a class of “u-url”. @nightpool why not, but that's yet another thing to specify and push to other implementors of the fediverse… |
|
Why would it have anything to do with other implementors in the fediverse? I'm just talking about for mastodon's API retrieval. |
|
I'm not necessarily against this PR, it just seems like if we want a more stable solution, explicitly specifying the account id server-side before sending it to the client is the most robust and easy to implement one. so something like |
|
Ah ok, I thought you were talking about specifying the markup of the toot itself, and not something returned from the API. |
35effb1 to
5561b56
Compare
|
btw, about that rel=mention, i didn't find it in the html the mastodon api returns, just class=mention. Where exactly are you using it? |
I got confused in my memory. It's rel=tag for hashtags, and class=u-url for mentions. rel=mention would have been consistent with rel=tag, but from a cursory google search, that does not seem to be a thing anywhere. rel=tag is indeed microformats. |
|
would it make sense for me to add that? where does the u-url come from? |
|
@lambadalambda The u-url comes from hcard (microformats), see full markup: https://github.com/tootsuite/mastodon/blob/master/app/lib/formatter.rb#L226 I like @nightpool's suggestion with data-mention-account. I think the sanitizer strips out such attributes from remote HTML so it should be fine for clients to expect it to be valid & local. |
5561b56 to
698f993
Compare
699f590 to
fa59849
Compare
|
Did this get adjusted on Pleroma's side? I would prefer to avoid these changes if possible. |
|
Yeah, pleroma has been changed to play nice with Mastodon afaict. However, the preview card fetching code will still try to fetch mentioned users. |
fa59849 to
bb737c4
Compare
|
Updated to simply stop Mastodon from fetching cards for mentioned users |
No description provided.