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

Use first link in remote fediverse (Mastodon) submission as post link #2889

Closed
jonaharagon opened this issue Jun 1, 2023 · 3 comments
Closed
Labels
area: federation support federation via activitypub enhancement New feature or request

Comments

@jonaharagon
Copy link

Ideally there would be a way to post links to Lemmy from alternative ActivityPub instances. Currently posts are simply imported as text-only posts regardless of content. I think that the proposed solution (from the referenced issue below) of grabbing the first link in the post logically makes the most sense. Any other links will still be included in the post body for consumption on Lemmy.

Alternatively, you could only create a link post from a Mastodon submission if the submitted post contains only a single link. If the post contains multiple links then you could handle it as it's currently handled.

Whatever you think looks cleaner.

I'm saying "Mastodon" in this issue, but I think this is the same with all microblogging ActivityPub platforms (Pleroma, CalcKey, etc.), so I don't think this is something to be solved on Mastodon's end specifically.


I have to disagree with the assessment at #2651 (comment) that the link isn't important, I came to this issue trying to find out why I couldn't make link posts from Mastodon.

Lemmy is a "link aggregator," how could this not be a priority?

Originally posted by @jonaharagon in #2590 (comment)

@Nutomic
Copy link
Member

Nutomic commented Jun 2, 2023

Here is an example Mastodon post with link: curl -H 'Accept: application/activity+json' https://mastodon.social/@panosalevropoulos/110473401276776507 | jq

As you can see the link is only included as part of the content HTML, not in any seperate json field. Extracting it would be very fragile and easy to break. So I dont think this is realistic unless the link is also federated in the attachment field or similar.

@Nutomic Nutomic added area: federation support federation via activitypub enhancement New feature or request labels Jun 2, 2023
@dessalines
Copy link
Member

dessalines commented Jun 2, 2023

I agree that it could be fragile, but just using the first link is still likely better than not using any at all. I def think this would be a good thing to add. If masto and other twitter types ever start using specific fields like attachments for links, (which is definitely better), then we can prefer that, or switch to it in the future.

@jonaharagon
Copy link
Author

Looking at the JSON response of a Lemmy post, I see what you mean. I'll also ask Mastodon to consider adding the link as an attachment the same way, however, I still think a fallback is important given Lemmy's target use-case. I see this as a UX improvement for Lemmy users specifically which might make this a difficult sell for other platforms.

Here is an example Mastodon post with link: curl -H 'Accept: application/activity+json' https://mastodon.social/@panosalevropoulos/110473401276776507 | jq

A more reliable Mastodon-specific way of extracting the link from this status could be to query https://mastodon.social/api/v1/statuses/110473401276776507 after receiving this status over federation, but I know that isn't ideal either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: federation support federation via activitypub enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants