TheEssem / mastodon

Chuckya, a glitch-soc fork used on wetdry.world
https://wetdry.world/@chuckya
GNU Affero General Public License v3.0
78 stars 10 forks source link

Display `content` of `Page` (e.g. Lemmy Posts) #1

Open ch0ccyra1n opened 1 year ago

ch0ccyra1n commented 1 year ago

Pitch

(Mirror of this upstream issue)

I don't quite get why Mastodon handles Page objects the way it does.

It seems like having it be in CONVERTED_TYPES (see line 9 of activity.rb) leads to rather ugly display of these in the Mastodon UI.

Example:

Here is a lemmy post: lemmy post titled how's your week going, Beehaw: "hello Beehaw, it’s a sleepy morning–and i did not get very much sleep. luckily i have no social priorities so this is not a big deal. currently reading a number of books after completely crashing out of doing that for the entire month of June. i think i can get about 3 in before the end of the month, we’ll see"

The same post viewed through a Mastodon instance: The same post viewed through a Mastodon instance. It only displays the title and a link to the post

The same post viewed through a Firefish (formerly Calckey) instance: The same post viewed through a Firefish instance. The title, content, and link to the post are displayed

The JSON-LD of this post is as-follows:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "lemmy": "https://join-lemmy.org/ns#",
      "litepub": "http://litepub.social/ns#",
      "pt": "https://joinpeertube.org/ns#",
      "sc": "http://schema.org/",
      "ChatMessage": "litepub:ChatMessage",
      "commentsEnabled": "pt:commentsEnabled",
      "sensitive": "as:sensitive",
      "matrixUserId": "lemmy:matrixUserId",
      "postingRestrictedToMods": "lemmy:postingRestrictedToMods",
      "removeData": "lemmy:removeData",
      "stickied": "lemmy:stickied",
      "moderators": {
        "@type": "@id",
        "@id": "lemmy:moderators"
      },
      "expires": "as:endTime",
      "distinguished": "lemmy:distinguished",
      "language": "sc:inLanguage",
      "identifier": "sc:identifier"
    }
  ],
  "type": "Page",
  "id": "https://beehaw.org/post/5006383",
  "attributedTo": "https://beehaw.org/u/alyaza",
  "to": [
    "https://beehaw.org/c/chat",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "name": "how's your week going, Beehaw",
  "cc": [],
  "content": "<p>hello Beehaw, it’s a sleepy morning–and i did not get very much sleep. luckily i have no social priorities so this is not a big deal. currently reading a number of books after completely crashing out of doing that for the entire month of June. i think i can get about 3 in before the end of the month, we’ll see</p>\n",
  "mediaType": "text/html",
  "source": {
    "content": "hello Beehaw, it's a sleepy morning--and i did not get very much sleep. luckily i have no social priorities so this is not a big deal. currently reading a number of books after completely crashing out of doing that for the entire month of June. i think i can get about 3 in before the end of the month, we'll see",
    "mediaType": "text/markdown"
  },
  "attachment": [],
  "commentsEnabled": true,
  "sensitive": false,
  "published": "2023-07-17T17:21:40.101789+00:00",
  "language": {
    "identifier": "en",
    "name": "English"
  },
  "audience": "https://beehaw.org/c/chat"
}

Ideally, we presumably would want to treat this object of the type Page similarly to how we treat an object of the type Note, where the content is displayed to the user. Thus, it would make the most sense to display these similarly to how Firefish handles it.

Motivation

I think that it only makes sense to display objects of all sorts as completely as possible when it comes to federation, and displaying the content of a Page seems like a good step in that direction. This feature would benefit anyone who follows an account from any instance that uses Page in any capacity.

TheEssem commented 1 year ago

This could definitely be interesting to add, I wonder if simply putting it in SUPPORTED_TYPES would do? Would test that but I can't really find a way to provide test inbox input in a local environment, and I don't want to test it in production because it could probably break things.

ch0ccyra1n commented 1 year ago

I would be down to run a test on a temporary server and share the results here if that would help.

ch0ccyra1n commented 1 year ago

Ok I was able to test by putting Page in SUPPORTED_TYPES and here's my findings:

The results are better but not ideal

Here's a lemmy post: image The same post on regular chuckya: image The same post on modified chuckya: image

As you can see, the title of the post is not federated in the third screenshot, so it's likely that we will need to write code for a separate type in order for Pages to display how we want them to be.

I'll keep you posted!