Federating the content of posts (Note, Articles and character limits)

How the content of a “post” gets federated has arisen in a few contexts. I’m creating this topic to collect some thoughts on it. I’ve also wikified this topic so different implementers in the threadiverse can add their current implementation.

Discourse

An actor with publication capabilities (e.g. a category) can federate posts as a Note or an Article. This is configurable via a setting. When federating a Note there is a maximum character length, configurable by setting, which defaults to 500 characters. The section of a post that is federated as a Note can be selected by the user using bbcode [note][/note]. When federating an Article the entire content of a post is sent.

Example Create > Note
id: https://angus.ngrok.io/ap/activity/64912a54588bcdcaf1c1731960f5a460
type: Create
audience: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
to: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
cc:
- https://www.w3.org/ns/activitystreams#Public
published: '2024-04-15T12:02:35Z'
updated: '2024-04-15T12:02:35Z'
actor:
  id: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
  type: Group
  updated: '2024-03-15T13:17:56Z'
  url: https://angus.ngrok.io/c/general/4
  name: General
  inbox: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a/inbox
  outbox: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a/outbox
  followers: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a/followers
  preferredUsername: general
  publicKey:
    id: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a#main-key
    owner: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
    publicKeyPem: |
      -----BEGIN PUBLIC KEY-----
      MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoz6w29Q529DYn0GojPAE
      HjYjGzgH5aDTs9/8kjBRoCTC7mc1z7/er7jwfyhS29twHvq03eusSuhWOCfCjVLV
      gJGP50oXHDObKdLRsH4XB9ygiTj0+KMIcWr2JRJN/KM0XysfmjdkcAy1KzH89YVd
      pQEVDoWPIAQ5LpwXgos41cLWbYlBsg/9jor32JZ6wHsfD1iU75haf6q0y0N7mxZi
      U2DGVb9liuLAWqkO/z3hRjKv12CqPTuqG5DyUcV9a/VK2i17h2cZ1dWIkts9QH0C
      tGGf4gGspZm4auL4QvrzCz05mOCc3vJ36phvZgb6JVuoMsTDRfs0wZ1/5kwN+FK6
      KQIDAQAB
      -----END PUBLIC KEY-----
  icon:
    type: Image
    mediaType: image/png
    url: http://localhost:3000/images/discourse-logo-sketch-small.png
  "@context": https://www.w3.org/ns/activitystreams
"@context": https://www.w3.org/ns/activitystreams
object:
  id: https://angus.ngrok.io/ap/object/e9b5e3f77f77259407c3542c4d04d898
  type: Note
  audience: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
  to: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
  cc:
  - https://www.w3.org/ns/activitystreams#Public
  published: '2024-04-15T12:02:35Z'
  updated: '2024-04-15T12:02:36Z'
  url: https://angus.ngrok.io/t/this-is-a-topic-that-will-federate-a-note/87/1
  attributedTo: https://angus.ngrok.io/ap/actor/6a0f2575a9d301173a45f3619b15656a
  name: This is a topic that will federate a Note
  content: "<p>This is the content of the Note with a limit of 500 characters.</p>"
  "@context": https://www.w3.org/ns/activitystreams

Create > Article is exactly the same, as Create > Note besides:

  1. The content will be the entire post (without limits)
  2. The type of the object will be Article.

NodeBB

NodeBB uses “topics” that contain “posts”. A topic is merely a shell and contains (among other things) the id and title, but the “meat” is contained in posts. OP is a post, replies are posts.

NodeBB currently federates everything (including OP) out as Note, with no character limits. It will also send the raw markdown in source.content, but content might be additionally parsed by other filters and plugins (e.g. emoji, rich previews, etc.)

NodeBB may in the future also federate out an Article with the initial topic creation. Waiting for movement from WG before proceeding.

Lemmy

Lemmy simply federates the full text as Page.

[Add your implementation in here]

2 Likes

Note that Threadiverse Working Group is currently set to federate:

  1. Notes;
  2. with the character limit set at 500 characters.

It will probably make sense to change this category to federating Articles (with no char limit), but I want to see what others support first, before we change from the “mastodon default” as it were.

I dont think this should be configurable at all. If the federated content is limited to 500 characters, how do you expect remote instances to retrieve the full post content? It would be very annoying for users if they have to open an external link every time. Lemmy simply federates the full text as Page.

It is configurable in the Discourse plugin because currently Mastodon only processes the content of Notes up to a default character limit of 500 characters. With the same default in the Discourse plugin that means you can start federating with Mastodon “out of the box”, which is what most users try first (currently anyway). The default may change. And as mentioned, I don’t think it makes sense for our uses here. I’ll change it once we reach some kind of overlapping consensus here.

Could you add that, with an example to the OP (it’s a wiki)?

Hmm in case of Lemmy Pages, Mastodon only shows the title and a link to the original site. You can try by fetching this url from Mastodon. Arguably thats exactly what you want, and still allows for proper federation between platforms that support long form text.

Yeah, Mastodon does the same thing with Articles. And that is where we’ll likely end up with this category at least, i.e. just a link appearing in Mastodon. But nevertheless, the reason this behaviour is configurable in the Discourse plugin is to accommodate different use cases.

Mastodon only processes the content of Notes up to a default character limit of 500 characters

this is only for local posts. remote Notes can have any character limit.

the difference between a Note and an Article is not well-defined, but was intended such that an Article is to be published as an independent unit of syndication (like HTML article). nowadays on mastodon-fedi the Note is what gets syndicated fully whereas the Article is linkified for viewing on the original site. it would probably make more sense to treat as such:

  • Article: self-contained formatted text, can be viewed on its own
  • Note: one-off text message, makes more sense in context

so this suggests Note (with full contents) for forum federation. but again, it’s not formally defined. one could also use Article as MDN advises (or at least <article> anyway)

see also:

3 Likes

Ah! I see. Ok, I got that wrong then. I will look at removing that.

Yeah, it looks that will likely be the plurality default if Mastodon also processes remote Notes without limit.

1 Like

The fact that Mastodon allows content with character limits greater than that locally specified (e.g. 500) is great for other implementors like us. We ought to take that and run with it before Eugen changes his mind :wink:

So definitely just excise all of that logic out @angus, it’ll only serve to confuse!

I have updated OP with NodeBB’s info.

2 Likes

Ok the Discourse default character limit will be 0 (off) when this PR is merged

2 Likes

@angus looks like the two relevant PRs were merged today. Any chance you can get it up on your dev instance so we can test? :slight_smile:

2 Likes

Both my dev instance and socialhub are now updated to the latest :slight_smile:

2 Likes

4 posts were split to a new topic: Addressing of post objects