You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.The text was updated successfully, but these errors were encountered: