Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Use contentMap for content when no content is set #3617

Open
tsmethurst opened this issue Dec 11, 2024 · 2 comments
Open

[feature] Use contentMap for content when no content is set #3617

tsmethurst opened this issue Dec 11, 2024 · 2 comments
Labels
enhancement New feature or request federation Issue relates to S2S/federation

Comments

@tsmethurst
Copy link
Contributor

Some softwares seem to publish using only contentMap rather than content and contentMap. We should update the AP converter/extractor thingy to take account of this. Example:

      {
        "@context": [
          "https://www.w3.org/ns/activitystreams",
          "as:Hashtag",
          "https://w3id.org/security/v1"
        ],
        "id": "https://feedsin.space/feed/kaniyam/items/759755",
        "type": "Create",
        "actor": "https://feedsin.space/feed/kaniyam",
        "cc": [
          "https://feedsin.space/feed/kaniyam/followers"
        ],
        "published": "2023-12-11T09:00:18Z",
        "to": "https://www.w3.org/ns/activitystreams#Public",
        "object": {
          "attributedTo": "https://feedsin.space/feed/kaniyam",
          "cc": [
            "https://feedsin.space/feed/kaniyam/followers"
          ],
          "contentMap": {
            "en-us": "<a href=\"https:&#x2F;&#x2F;kaniyam.com&#x2F;%e0%ae%b5%e0%ae%be%e0%ae%b0%e0%ae%be%e0%ae%a8%e0%af%8d%e0%ae%a4%e0%ae%bf%e0%ae%b0-%e0%ae%9a%e0%af%86%e0%ae%af%e0%af%8d%e0%ae%a4%e0%ae%bf%e0%ae%95%e0%ae%b3%e0%af%8d-weekly-news-2023-05-01-2&#x2F;\">வாராந்திர செய்திகள் (Weekly News) – 2023-05-01</a><br />\n\n<p>இந்த நிகழ்படத்தில் கடந்த இரண்டு வாரங்களாக கட்டற்ற மென்பொருள் உலகத்தில் நடந்த நிகழ்வுகளில் எங்களுக்கு தெரிந்த நிகழ்வுகளை பகிர்ந்துள்ளோம். பங்களித்தவர்கள்: மோகன் ராமன் ILUGC பரமேஷ்வர் அருணாச்சலம் KanchiLUG செய்தி இணைப்புகள்: www.phoronix.com/news/SVT-AV1-1.5 news.itsfoss.com/huggingchat-chatgpt/ www.phoronix.com/news/GCC-13.1-Released Use ‘Upscaler’ to Enhance Low-Res Images with AI on Linux thehackernews.com/2023/04/nk-hackers-employ-matryoshka-doll-style.html www.bleepingcomputer.com/news/security/google-patches-another-actively-exploited-chrome-zero-day/ Clonezilla Live...<br><a class=\"read-more-button\" href=\"https://kaniyam.com/%e0%ae%b5%e0%ae%be%e0%ae%b0%e0%ae%be%e0%ae%a8%e0%af%8d%e0%ae%a4%e0%ae%bf%e0%ae%b0-%e0%ae%9a%e0%af%86%e0%ae%af%e0%af%8d%e0%ae%a4%e0%ae%bf%e0%ae%95%e0%ae%b3%e0%af%8d-weekly-news-2023-05-01-2/\">Read more</a></p><p><a href=\"https:&#x2F;&#x2F;feedsin.space&#x2F;tags&#x2F;tamil\" class=\"mention hashtag\" rel=\"tag\">#tamil</a></p>"
          },
          "id": "https://feedsin.space/feed/kaniyam/items/759755",
          "published": "2023-12-11T09:00:18Z",
          "summary": "",
          "tag": [
            {
              "href": "https://feedsin.space/tags/tamil",
              "name": "#tamil",
              "type": "Hashtag"
            }
          ],
          "to": "https://www.w3.org/ns/activitystreams#Public",
          "type": "Note",
          "url": "https://feedsin.space/feed/kaniyam"
        }
      }
@tsmethurst tsmethurst added enhancement New feature or request federation Issue relates to S2S/federation labels Dec 11, 2024
@daenney
Copy link
Member

daenney commented Dec 27, 2024

That message is broken as heck though 😅:

  • The content in their contentMap tagged en-us is mostly Tamil (in this example)
  • It's invalid to have as:Hashtag in the context like that, as that would be a remote context but obviously as:Hashtag can't be dereferenced

This message won't be federating successfully everywhere, because the context is broken. Anything that does JSON-LD processing (for example Iceshrimp) wouldn't be able to handle this in the first place.

Given that it's mixed language content, they should probably be using content and not contentMap. If they're using contentMap, it should probably be put in @none, not under en-us. They might be picking it up from the source feed though.

It might be better to get this fixed upstream in https://github.com/muffinista/rust-rss-to-fedi than us specially handling it. That would also fix issues other implementations might have.

@daenney
Copy link
Member

daenney commented Dec 27, 2024

We should handle the absence of content though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request federation Issue relates to S2S/federation
Projects
None yet
Development

No branches or pull requests

2 participants