this post was submitted on 15 Feb 2024
11 points (92.3% liked)

Learning Rust and Lemmy

388 readers
1 users here now

Welcome

A collaborative space for people to work together on learning Rust, learning about the Lemmy code base, discussing whatever confusions or difficulties we're having in these endeavours, and solving problems, including, hopefully, some contributions back to the Lemmy code base.

Rules TL;DR: Be nice, constructive, and focus on learning and working together on understanding Rust and Lemmy.


Running Projects


Policies and Purposes

  1. This is a place to learn and work together.
  2. Questions and curiosity is welcome and encouraged.
  3. This isn't a technical support community. Those with technical knowledge and experienced aren't obliged to help, though such is very welcome. This is closer to a library of study groups than stackoverflow. Though, forming a repository of useful information would be a good side effect.
  4. This isn't an issue tracker for Lemmy (or Rust) or a place for suggestions. Instead, it's where the nature of an issue, what possible solutions might exist and how they could be or were implemented can be discussed, or, where the means by which a particular suggestion could be implemented is discussed.

See also:

Rules

  1. Lemmy.ml rule 2 applies strongly: "Be respectful, even when disagreeing. Everyone should feel welcome" (see Dessalines's post). This is a constructive space.
  2. Don't demean, intimidate or do anything that isn't constructive and encouraging to anyone trying to learn or understand. People should feel free to ask questions, be curious, and fill their gaps knowledge and understanding.
  3. Posts and comments should be (more or less) within scope (on which see Policies and Purposes above).
  4. See the Lemmy Code of Conduct
  5. Where applicable, rules should be interpreted in light of the Policies and Purposes.

Relevant links and Related Communities


Thumbnail and banner generated by ChatGPT.

founded 9 months ago
MODERATORS
11
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/[email protected]
 

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.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 1 points 8 months ago (1 children)

freamon replies to his own post, with an inline link to the same image, and an emoji

{
  "@context": [
    "https://join-lemmy.org/context.json",
    "https://www.w3.org/ns/activitystreams"
  ],
  "id": "https://local.com/activities/create/c394a258-eac5-4555-8b98-823002cbb88c",
  "actor": "https://local.com/u/freamon",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": {
    "type": "Note",
    "id": "https://local.com/comment/1",
    "attributedTo": "https://local.com/u/freamon",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "cc": [
      "https://remote.com/c/interesting",
      "https://local.com/u/freamon"
    ],
    "content": "<p>Comment text<br />\n<img src=\"https://i.imgur.com/T7Z3vUU.jpeg\" alt=\"\" /></p>\n<p>๐Ÿ˜œ</p>\n",
    "inReplyTo": "https://local.com/post/3",
    "mediaType": "text/html",
    "source": {
      "content": "Comment text              \n![](https://i.imgur.com/T7Z3vUU.jpeg)\n\n ๐Ÿ˜œ ",
      "mediaType": "text/markdown"
    },
    "published": "2024-02-13T21:48:18.776300Z",
    "tag": [
      {
        "href": "https://local.com/u/freamon",
        "name": "@[email protected]",
        "type": "Mention"
      }
    ],
    "distinguished": false,
    "audience": "https://remote.com/c/interesting"
  },
  "cc": [
    "https://remote.com/c/interesting",
    "https://local.com/u/freamon"
  ],
  "tag": [
    {
      "href": "https://local.com/u/freamon",
      "name": "@[email protected]",
      "type": "Mention"
    }
  ],
  "type": "Create",
  "audience": "https://remote.com/c/interesting"
}

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)

[โ€“] [email protected] 1 points 8 months ago (1 children)

freamon regrets his comment, and deletes it.

{
  "@context": [
    "https://join-lemmy.org/context.json",
    "https://www.w3.org/ns/activitystreams"
  ],
  "id": "https://local.com/activities/delete/c08be088-fd16-47fe-a286-3e0c24abc15b",
  "actor": "https://local.com/u/freamon",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": "https://local.com/comment/1",
  "type": "Delete",
  "audience": "https://remote.com/c/interesting",
  "cc": [
    "https://remote.com/c/interesting"
  ]
}
[โ€“] [email protected] 1 points 8 months ago

freamon changes his mind again, and undoes the delete

{
  "@context": [
    "https://join-lemmy.org/context.json",
    "https://www.w3.org/ns/activitystreams"
  ],
  "id": "https://local.com/activities/undo/91bd96a3-9fb8-4dde-acfb-3d7ee682a41a",
  "actor": "https://local.com/u/freamon",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": {
    "actor": "https://local.com/u/freamon",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "object": "https://local.com/comment/1",
    "type": "Delete",
    "id": "https://local.com/activities/delete/55f2f17e-6c5d-44f2-ae53-e65c8496dfc3",
    "audience": "https://remote.com/c/interesting",
    "cc": [
      "https://remote.com/c/interesting"
    ]
  },
  "type": "Undo",
  "audience": "https://remote.com/c/interesting",
  "cc": [
    "https://remote.com/c/interesting"
  ]
}