MRF.InlineQuotePolicy: Add link to post URL, not ID #733
No reviewers
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#733
Loading…
Reference in a new issue
No description provided.
Delete branch "erincandescent/akkoma:quote-url"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
"id" is used for the canonical link to the AS2 representation of an object. "url" is typically used for the canonical link to the HTTP representation. It is what we use, for example, when following the "external source" link in the frontend. However, it's not the link we include in the post contents for quote posts.
Using URL instead means we include a more user-friendly URL for Mastodon, and a working (in the browser) URL for Threads
I'm pretty ambivalent about Threads related interoperability fixes, but if we're gonna be subjected to quotes of threads'ers then at least the link should work
@ -34,3 +48,3 @@
String.trim_trailing(content, "</p>") <> build_inline_quote(prefix, quote_url) <> "</p>"
String.trim_trailing(content, "</p>") <> build_inline_quote(prefix, preferred_url) <> "</p>"
else
content <> build_inline_quote(prefix, quote_url)
ig this should also switch to
preferred_url
instead ofquote_url
?Good catch!
ae9f51a0c8
to6f521fd9bf
commits look good, but there's a lint issue - any chance you could
mix format
this? thankies6f521fd9bf
tob675b47c53
Oops, fixed
hm, tests indicate that this introduces a recursion issue when fetching quotes
i shall look into it
i'm not sure the best path to resolving this right now - i'm about 80% sure that quotes would have been fetched already, so refetching them here shouldn't be required, but i'd have to double-check the pipeline on that to confirm
@ -12,2 +14,3 @@
defp has_inline_quote?(content, quote_url) do
defp resolve_urls(quote_url) do
with %Object{} = obj <- Object.normalize(quote_url, fetch: true) do
the issue is the
fetch: true
you've addedwe've got a test to check for handling self-referential quotes (as naturally it'd be a DoS vector) - having this
fetch: true
here makes that failfor reference, why this happens:
we try to fetch a quote
pipeline
It goes through the inbound AP pipeline
which puts it through this (as it is enabled by default)
quote URL is detected, let's fetch it (because fetch is true here)
GOTO pipeline
I wonder if we could just run this for outbound messages? I will have to take a look at precisely how MRFs are run to see if thats a feasible option
You know what, I'm tempted to just change it to
fetch: false
. Its gotta be astoundingly rare for someone to be quoting a post the server doesn't know aboutb675b47c53
to75d9e2b375
OK, I made it not fetch. If the object isn't fetched (exceptional case!) we'll fall back to the old behaviour, which was fine.
all good now, thanks for fixing it~