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

Compatibility with Mastodon private messages #2657

Closed
Nutomic opened this issue Jan 15, 2023 · 3 comments
Closed

Compatibility with Mastodon private messages #2657

Nutomic opened this issue Jan 15, 2023 · 3 comments
Labels
area: federation support federation via activitypub enhancement New feature or request

Comments

@Nutomic
Copy link
Member

Nutomic commented Jan 15, 2023

In the interest of better compatibility it would be good of Lemmy users could exchange private messages with Mastodon and similar platforms. This is currently impossible because we use the ChatMessage type for private messages.

Changing this is complicated, because we route incoming federation activities based on their json structure. This works very well in general, with private messages being the only exception. The problem is that the json structure of a Lemmy comment and a Mastodon private message are identical. The only difference are the presence of https://www.w3.org/ns/activitystreams#Public and community id in to/cc. Unfortunately this cant easily be encoded in serde data structures, so a custom deserializer might be the only solution (which would be complicated).

A better solution would be if we could check the audience property if that ever gets supported by Mastodon, or a property like privacy: "Public|Followers|Private" which would be much easier to parse.

@Nutomic Nutomic added enhancement New feature or request area: federation support federation via activitypub labels Jan 15, 2023
@RocketDerp

This comment was marked as abuse.

@uis246
Copy link

uis246 commented Aug 3, 2023

https://socialhub.activitypub.rocks/t/distinguish-between-posts-and-direct-messages/2283

property visibility with the value "direct"

@Nutomic
Copy link
Member Author

Nutomic commented Oct 3, 2023

I gave this a try in https://github.com/LemmyNet/lemmy/tree/federate-mastodon-pms. But its really hard to get working now, as it means that comments and private messages get serialized in the exact same format so its tricky to distinguish them. With private message its doable to check that neither to nor cc contains public as recipient. But for comment it requires a check that either to or cc must contain public. That is only possible with complicated workarounds, or once serde-rs/serde#642 gets implemented.

@uis246 This property might help but it doesnt seem to exist in current Mastodon version, see here.

Nutomic added a commit that referenced this issue Nov 22, 2024
Nutomic added a commit that referenced this issue Nov 22, 2024
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