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

Mastodon: Support Content Warning #3285

Closed
MrPetovan opened this Issue Apr 3, 2017 · 5 comments

Comments

3 participants
@MrPetovan
Collaborator

MrPetovan commented Apr 3, 2017

Original: https://mastodon.social/users/dia/updates/1518924
Friendica: https://friendica.mrpetovan.com/display/52acf9cd888b8ed9b472abac0789e9547341987c

XML:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:mastodon="http://mastodon.social/schema/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:thr="http://purl.org/syndication/thread/1.0">
   <id>https://mastodon.social/users/dia.atom</id>
   <title>&amp;#x2666;&amp;#xFE0F;&amp;#xFF24;&amp;#xFF49;&amp;#xFF41;&amp;#x2666;&amp;#xFE0F;</title>
   <subtitle>I like you!</subtitle>
   <updated>2017-04-03T11:35:30Z</updated>
   <logo>https://files.mastodon.social/accounts/avatars/000/006/755/original/0a7d7fa7d8f24c98.png?1491173125</logo>
   <author>
      <id>https://mastodon.social/users/dia</id>
      <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
      <uri>https://mastodon.social/users/dia</uri>
      <name>dia</name>
      <email>dia@mastodon.social</email>
      <summary>I like you!</summary>
      <link rel="alternate" type="text/html" href="https://mastodon.social/@dia" />
      <link rel="avatar" type="image/png" media:width="120" media:height="120" href="https://files.mastodon.social/accounts/avatars/000/006/755/original/0a7d7fa7d8f24c98.png?1491173125" />
      <link rel="header" type="image/png" media:width="700" media:height="335" href="https://files.mastodon.social/accounts/headers/000/006/755/original/POqg3uN.png?1480857915" />
      <poco:preferredUsername>dia</poco:preferredUsername>
      <poco:displayName>&amp;#x2666;&amp;#xFE0F;&amp;#xFF24;&amp;#xFF49;&amp;#xFF41;&amp;#x2666;&amp;#xFE0F;</poco:displayName>
      <poco:note>I like you!</poco:note>
      <mastodon:scope>public</mastodon:scope>
   </author>
   <link rel="alternate" type="text/html" href="https://mastodon.social/@dia" />
   <link rel="self" type="application/atom+xml" href="https://mastodon.social/users/dia.atom" />
   <link rel="hub" href="https://mastodon.social/api/push" />
   <link rel="salmon" href="https://mastodon.social/api/salmon/6755" />
   <entry>
      <id>tag:mastodon.social,2017-04-03:objectId=1484062:objectType=Status</id>
      <published>2017-04-03T11:35:30Z</published>
      <updated>2017-04-03T11:35:30Z</updated>
      <title>@Mutsui &amp;#xE0; la fin ils meurent</title>
      <summary>spoilers rom&amp;#xE9;o et juliette</summary>
      <content type="html">&amp;lt;p&amp;gt;&amp;lt;a href="https://mastodon.social/@Mutsui" class="h-card u-url p-nickname mention"&amp;gt;@&amp;lt;span&amp;gt;Mutsui&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; &amp;#xE0; la fin ils meurent&amp;lt;/p&amp;gt;</content>
      <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
      <link rel="self" type="application/atom+xml" href="https://mastodon.social/users/dia/updates/1518924.atom" />
      <link rel="alternate" type="text/html" href="https://mastodon.social/users/dia/updates/1518924" />
      <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
      <thr:in-reply-to ref="tag:mastodon.social,2017-04-03:objectId=1484051:objectType=Status" href="https://mastodon.social/@dia/1484051" type="text/html" />
      <link rel="mentioned" href="https://mastodon.social/users/Mutsui" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" />
      <mastodon:scope>unlisted</mastodon:scope>
   </entry>
</feed>

Not sure if the Content Warning is passed in the XML object, maybe it's a Mastodon feature request to pass the info in the XML first. Any idea @annando ?

@annando

This comment has been minimized.

Collaborator

annando commented Apr 3, 2017

If @Gargron tells where this is hidden, we can add some #nsfw tag to it to trigger our own system.

@MrPetovan

This comment has been minimized.

Collaborator

MrPetovan commented Apr 3, 2017

Another unfortunate example:

Mastodon: https://mastodon.xyz/users/alex73630/updates/3212
Friendica: https://friendica.mrpetovan.com/display/47cb7c42f887b8dbbe6a327c04551ac37ce46677

XML Object:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:mastodon="http://mastodon.social/schema/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:thr="http://purl.org/syndication/thread/1.0">
   <author>
      <id>https://mastodon.xyz/users/alex73630</id>
      <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
      <uri>https://mastodon.xyz/users/alex73630</uri>
      <name>alex73630</name>
      <email>alex73630@mastodon.xyz</email>
      <summary>Jeune d&amp;#xE9;veloppeur web autodidacte. Admin de l'instance https://social.alex73630.xyz Le &amp;#x2705; c'est trop mainstream. Sauf pour @alex73630@social.alex73630.xyz</summary>
      <link rel="alternate" type="text/html" href="https://mastodon.xyz/@alex73630" />
      <link rel="avatar" type="image/jpeg" media:width="120" media:height="120" href="https://mastodon.xyz/system/accounts/avatars/000/000/455/original/67a2eb463f968ff4.jpg?1491177171" />
      <link rel="header" type="" media:width="700" media:height="335" href="https://mastodon.xyz/headers/original/missing.png" />
      <poco:preferredUsername>alex73630</poco:preferredUsername>
      <poco:displayName>Alexandre Sanchez &amp;#x274E;</poco:displayName>
      <poco:note>Jeune d&amp;#xE9;veloppeur web autodidacte. Admin de l&amp;apos;instance &amp;lt;a href="https://social.alex73630.xyz" rel="nofollow noopener" target="_blank"&amp;gt;&amp;lt;span class="invisible"&amp;gt;https://&amp;lt;/span&amp;gt;&amp;lt;span class=""&amp;gt;social.alex73630.xyz&amp;lt;/span&amp;gt;&amp;lt;span class="invisible"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; Le &amp;#x2705; c&amp;apos;est trop mainstream. Sauf pour &amp;lt;a href="https://social.alex73630.xyz/@alex73630" class="h-card u-url p-nickname mention"&amp;gt;@&amp;lt;span&amp;gt;alex73630&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;</poco:note>
      <mastodon:scope>public</mastodon:scope>
   </author>
   <id>tag:mastodon.xyz,2017-04-03:objectId=19190:objectType=Status</id>
   <published>2017-04-03T15:49:25Z</published>
   <updated>2017-04-03T15:49:25Z</updated>
   <title>Poke @TheKinrar @Gargron@mastodon.social</title>
   <summary>Quelqu'un sait comment modifier la page home d'une instance Mastodon ? Someone knows how to edit home page on an Mastodon instance ?</summary>
   <content type="html">&amp;lt;p&amp;gt;Poke &amp;lt;a href="https://mastodon.xyz/@TheKinrar" class="h-card u-url p-nickname mention"&amp;gt;@&amp;lt;span&amp;gt;TheKinrar&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; &amp;lt;a href="https://mastodon.social/@Gargron" class="h-card u-url p-nickname mention"&amp;gt;@&amp;lt;span&amp;gt;Gargron&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;</content>
   <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
   <link rel="self" type="application/atom+xml" href="https://mastodon.xyz/users/alex73630/updates/3212.atom" />
   <link rel="alternate" type="text/html" href="https://mastodon.xyz/users/alex73630/updates/3212" />
   <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
   <link rel="mentioned" href="http://activityschema.org/collection/public" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" />
   <link rel="mentioned" href="https://mastodon.xyz/users/TheKinrar" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" />
   <link rel="mentioned" href="https://mastodon.social/users/Gargron" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" />
   <mastodon:scope>public</mastodon:scope>
</entry>
@MrPetovan

This comment has been minimized.

Collaborator

MrPetovan commented Apr 9, 2017

I've got an answer from Gargron: Everything is in the summary tag. If it's present, it should be the clear text, while the content should be hidden by default only to be revealed by a click.

@MrPetovan MrPetovan self-assigned this Apr 9, 2017

annando added a commit that referenced this issue Apr 11, 2017

Merge pull request #3315 from Hypolite/issue/#3285
Add spoiler tags for Mastodon Content Warning
@MrPetovan

This comment has been minimized.

Collaborator

MrPetovan commented Apr 22, 2017

Closed via #3315

@MrPetovan MrPetovan closed this Apr 22, 2017

@Gargron

This comment has been minimized.

Gargron commented Apr 23, 2017

👍 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment