Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

=> AP: contentMap values should be HTML #1609

Open
Tamschi opened this issue Dec 6, 2024 · 5 comments
Open

=> AP: contentMap values should be HTML #1609

Tamschi opened this issue Dec 6, 2024 · 5 comments
Labels
bug User-facing breakage and reliability issues within Bridgy Fed.

Comments

@Tamschi
Copy link
Collaborator

Tamschi commented Dec 6, 2024

Current example with plaintext in #1607. It should have the same semantics as content: #1607 (comment)

The properties are in fact mapped to the same key in https://www.w3.org/ns/activitystreams, just with different transforms:

"content": "as:content",
"contentMap": {
    "@id":"as:content",
    "@container":"@language"
},

(This is valid, they just become an array after expansion like this:

"https://www.w3.org/ns/activitystreams#content": [
  {
    "@value": "<p>OMG OMG OMG we're able to bridge our threads accounts into Blue sky via federation <a class=\"mention\" href=\"https://ap.brid.gy/ap.brid.gy\">@ap.brid.gy</a>  & <a class=\"mention\" href=\"https://bsky.app/profile/snarfed.org\">@snarfed.org</a><br><br>RE: <a href=\"https://bsky.app/profile/did:plc:4ghwklnin2mvmam4ditdwv2o/post/3lclod7ptodd2\">https://bsky.app/profile/did:plc:4ghwklnin2mvmam4ditdwv2o/post/3lclod7ptodd2</a></p>"
  },
  {
    "@value": "OMG OMG OMG we're able to bridge our threads accounts into Blue sky via federation @ap.brid.gy  & @snarfed.org",
    "@language": "en"
  }
],

(via https://json-ld.org/playground/)

@Tamschi Tamschi added the bug User-facing breakage and reliability issues within Bridgy Fed. label Dec 6, 2024
@snarfed snarfed added now and removed now labels Dec 6, 2024
@panosda
Copy link

panosda commented Dec 16, 2024

This is probably related to why links in bridged posts don't work in firefish and catodon. More context: https://chat.iceshrimp.dev/#narrow/stream/6-support/topic/.E2.9C.94.20Links.20from.20Bridgy.20Fed.20not.20working.20on.20-js

@Tamschi
Copy link
Collaborator Author

Tamschi commented Dec 16, 2024

Do Firefish and Catodon allow toggling the post display language if there's a contentMap?

@Tamschi
Copy link
Collaborator Author

Tamschi commented Dec 16, 2024

I had a look at Catodon's code. In order of decreasing priority it uses:

  • source.content iff source.mediaType is "text/x.misskeymarkdown", language-tagged1 with the first key in contentMap.
  • The first entry in contentMap.
  • Nothing if contentMap is present but empty.2
  • _misskey_content.
  • content

So no, no mutli-language support, it just picks the content a bit differently.3
It appears to use MFM as native storage format, so any HTML is converted into that representation.

Footnotes

  1. Language-tagging is subject to an allow-list of supported languages. If not supported, the information is discarded entirely, I think.

  2. This directly mismatches JSON-LD processing rules, I think. Oh well. Interestingly though, I think this could cause it to treat a quote as a boost/renote in some cases.

  3. Which isn't a vulnerability because you can present distinct content to different servers in ActivityPub anyway.

@panosda
Copy link

panosda commented Dec 17, 2024

Hey, sorry for not being more helpful, but I'm not a dev. I just asked in Iceshrimp and a dev told me that bridgy fed doesn't include the correct link in contentmap, and that this is the reason links don't work for us. Do you think this could be fixed on your side? Thanks!

@Tamschi
Copy link
Collaborator Author

Tamschi commented Dec 17, 2024

Yes, this is squarely a bug on our side. Catodon's behaviour is correct here, just a little unusual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug User-facing breakage and reliability issues within Bridgy Fed.
Projects
None yet
Development

No branches or pull requests

3 participants