I'll reply in the comments with a example of what lemmy sends for each thing you can do (I think I've thought of everything, but you can probably guess the format if not, or I can always add it).
So, the setup for these is:
Our instance is called 'local.com'
Our user is called 'freamon'
The other instance is called 'remote.com'
The community on that instance is called 'interesting'
For many of these, remote.com will receive them, and rewraps them in an Announce to send out to all the other instances with a copy of the community, so everyone stays in sync.
Sort by 'Old' for the best hope of these making sense.
I'll follow this post up with a script, that can be used to send these activities from the command-line, as I think it can help to understand Lemmy if you're using something much simpler than Lemmy to do some of things Lemmy does.
EDIT: As nutomic as mentioned, a better list is in the docs. It's the kind of thing I should read first, I guess.
Oh. I feel daft now. That's some nice, comprehensive documentation, that I hadn't seen before. I'll edit this post to point to it, and I guess people can maybe use it if they want to comment about a particular activity.
Its also good to explore for yourself. Maybe you notice something missing/outdated in the documentation and can fix it. The docs are generated from these files which are also used in the unit tests.
Yea but repetition legitimises! (A reference/joke BTW)
Seriously though @[email protected] , how are you deriving all of these? From theoretical understanding of what should happen or actual observations of a test system?
Observation, mostly. Also guesswork and trial-and-error, because I never realised these were all in the docs.
The comments in here are from me running lemmy in a VM, and subscribing to a fake community on a VPS (you can mimic a community with a webfinger response and a bunch of static files). The activities sent by lemmy just went to a basic server, that dumped out the JSON files it received.
I mostly made this post so I could point to something when posting about a Ruby script that can be used to interact with lemmy from the command line. This provides the opportunity to learn about ActivityPub, separate from the more complicated applications that currently implement it.
Note 1: lemmy uses 'Page' for a post, and 'Note' for a comment, whereas mastodon uses 'Note' for both, with 'inReplyTo' distinguishing between the two.
Note 2: this is sent to the main community at remote.com, and also to the post's author (it would appear in his inbox if they weren't the same person)
For an example of an Announce encapsulating these, I'll use this post. The format is always the same from what I've seen (the 'context' is moved to the top level, and the original activity is placed inside as an 'object').
{
"actor": "https://lemmy.ml/c/learningrustandlemmy",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"id": "https://lemmy.ml/activities/create/191df452-33a6-4861-8218-6f1702f39fe3",
"actor": "https://endlesstalk.org/u/freamon",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"object": {
"type": "Page",
"id": "https://endlesstalk.org/post/22923810",
"attributedTo": "https://endlesstalk.org/u/freamon",
"to": [
"https://lemmy.ml/c/learningrustandlemmy",
"https://www.w3.org/ns/activitystreams#Public"
],
"name": "Lemmy's ActivityPub activities",
"cc": [],
"content": "<p>I’ll reply in the comments with a example of what lemmy sends for each thing you can do (I think I’ve t hought of everything, but you can probably guess the format if not, or I can always add it).</p>\n<p>So, the setup for these is:<br>\nOur instance is called ‘local.com’<br>\nOur user is called ‘freamon’<br>\nThe other instance is called ‘remo te.com’<br>\nThe community on that instance is called ‘interesting’</p>\n<p>For many of these, remote.com will receive the m, and rewraps them in an Announce to send out to all the other instances with a copy of the community, so everyone stays in sync.</p>\n",
"mediaType": "text/html",
"source": {
"content": "I'll reply in the comments with a example of what lemmy sends for each thing you can do (I think I've th ought of everything, but you can probably guess the format if not, or I can always add it).\n\nSo, the setup for these is: \nOur instance is called 'local.com' \nOur user is called 'freamon' \nThe other instance is called 'remo te.com' \nThe community on that instance is called 'interesting' \n\nFor many of these, remote.com will receive them, and rewraps them in an Announce to send out to all the other instances with a copy of the community, so everyone stay s in sync.\n",
"mediaType": "text/markdown"
},
"attachment": [],
"commentsEnabled": true,
"sensitive": false,
"published": "2024-02-15T12:08:08.036884Z",
"updated": "2024-02-15T12:42:34.861055Z",
"language": {
"identifier": "en",
"name": "English"
},
"audience": "https://lemmy.ml/c/learningrustandlemmy"
},
"cc": [
"https://lemmy.ml/c/learningrustandlemmy"
],
"type": "Create",
"audience": "https://lemmy.ml/c/learningrustandlemmy"
},
"cc": [
"https://lemmy.ml/c/learningrustandlemmy/followers"
],
"type": "Announce",
"id": "https://lemmy.ml/activities/announce/create/6689f68f-1fc4-44d2-9d0a-0e200d469e48"
}
Note 1: lemmy expects these 'id' fields to be unique, so the encapulated 'Follow' isn't the same as the one that was sent.
Note 2: lemmy also sends a Undo/Follow if you block a community