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

ActivityPub => ATProto @-mentions #957

Closed
Tracked by #381
snarfed opened this issue Apr 15, 2024 · 8 comments
Closed
Tracked by #381

ActivityPub => ATProto @-mentions #957

snarfed opened this issue Apr 15, 2024 · 8 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented Apr 15, 2024

The AS2 tags coming from eg Mastodon have displayName as the full @user@instance handle, but only @user in text, so we don't currently find them.

Example AS2:

{
  "type": "Note",
  "id": "https://indieweb.social/users/snarfed/statuses/112276475646675266",
  "url": "https://indieweb.social/@snarfed/112276475646675266",
  "content": "<p><span class=\"h-card\" translate=\"no\"><a href=\"https://atproto.brid.gy/r/https://bsky.app/profile/snarfed.org\" class=\"u-url mention\">@<span>snarfed.org</span></a></span> funny</p>",
  "tag": [{
      "type": "Mention",
      "href": "https://atproto.brid.gy/ap/did:plc:fdme4gb7mu7zrie7peay7tst",
      "name": "@[email protected]"
    }],
  "..."
}

...which we convert to this AS1:

{
  "objectType": "comment",
  "id": "https://indieweb.social/users/snarfed/statuses/112276475646675266",
  "url": "https://indieweb.social/@snarfed/112276475646675266",
  "content": "<p><span class=\"h-card\" translate=\"no\"><a href=\"https://atproto.brid.gy/r/https://bsky.app/profile/snarfed.org\" class=\"u-url mention\">@<span>snarfed.org</span></a></span> funny</p>",
  "tags": [{
      "objectType": "mention",
      "displayName": "@[email protected]",
      "url": "did:plc:fdme4gb7mu7zrie7peay7tst"
    }],
  "..."
}
@qazmlp
Copy link

qazmlp commented Apr 15, 2024

I wonder if those are just applied in order of appearance to the class=mention links, without comparisons at all, or if they're wholly separate and the links are resolved via WebFinger and cached.

There are also a few applications (HubZilla?) that use different formatting like not including the '@' in the mention link.

@snarfed
Copy link
Owner Author

snarfed commented Apr 15, 2024

Gory details on ActivityPub and Mastodon specific @-mention AS2 requirements in #493. We figured those out a while back, and we have bridged @-mentions working for web <=> AP (both directions) and web => ATProto, so this is AP => ATProto specific somehow.

@qazmlp
Copy link

qazmlp commented Apr 16, 2024

As mentioned in #959 (comment), it doesn't seem like "content" and "tag" necessarily have any meaningful relation for processing in the fediverse. You'll probably have to resolve <a href="…">…</a> URLs to accounts (and maybe posts for quote boosts?) via active requests at some points.

While Mastodon uses microformats to potentially make those easier to recognise, it says these are deprecated. Pixelfed also applies u-url, but doesn't wrap mentions in an h-card, which seems not entirely compatible with Mastodon's concept where u-url has multiple meanings (though does always point to an ActivityPub Object).

@snarfed snarfed added the now label May 2, 2024
@snarfed snarfed removed the now label May 9, 2024
@snarfed snarfed added the now label May 15, 2024
snarfed added a commit that referenced this issue May 20, 2024
@snarfed
Copy link
Owner Author

snarfed commented May 20, 2024

@snarfed snarfed closed this as completed May 20, 2024
@qazmlp
Copy link

qazmlp commented May 20, 2024

Does this include @-mentions of AP users (bridged/non-bridged)?

Edit: Just saw that local mentions are translated as bridged, at least if possible 👍

@snarfed
Copy link
Owner Author

snarfed commented May 21, 2024

@snarfed snarfed reopened this May 21, 2024
@snarfed
Copy link
Owner Author

snarfed commented May 21, 2024

This definitely regressed somehow. 😕 More examples: https://bsky.app/profile/did:plc:whco57z2rz6jvi3wv3o56jdi

@snarfed
Copy link
Owner Author

snarfed commented May 31, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants