mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:55:19 +00:00
Add 'sensitive' flag to posts tagged n-s-f-w for the benefit of Mastodon folks.
This commit is contained in:
parent
ee3120427a
commit
b98c6f18ef
1 changed files with 12 additions and 2 deletions
|
@ -933,6 +933,11 @@ class Activity
|
||||||
|
|
||||||
$t = self::encode_taxonomy($item);
|
$t = self::encode_taxonomy($item);
|
||||||
if ($t) {
|
if ($t) {
|
||||||
|
foreach($t as $tag) {
|
||||||
|
if (strcasecmp($tag['name'], '#nfsw') === 0) {
|
||||||
|
$activity['sensitive'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
$activity['tag'] = $t;
|
$activity['tag'] = $t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1297,6 +1302,11 @@ class Activity
|
||||||
|
|
||||||
$t = self::encode_taxonomy($item);
|
$t = self::encode_taxonomy($item);
|
||||||
if ($t) {
|
if ($t) {
|
||||||
|
foreach($t as $tag) {
|
||||||
|
if (strcasecmp($tag['name'], '#nfsw') === 0) {
|
||||||
|
$activity['sensitive'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
$activity['tag'] = $t;
|
$activity['tag'] = $t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4558,7 +4568,7 @@ class Activity
|
||||||
'schema' => 'http://schema.org#',
|
'schema' => 'http://schema.org#',
|
||||||
'litepub' => 'http://litepub.social/ns#',
|
'litepub' => 'http://litepub.social/ns#',
|
||||||
'sm' => 'http://smithereen.software/ns#',
|
'sm' => 'http://smithereen.software/ns#',
|
||||||
// 'fep' => 'https://codeberg.org/fediverse/fep#',
|
'fep' => 'https://codeberg.org/fediverse/fep#',
|
||||||
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
|
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
|
||||||
'oauthRegistrationEndpoint' => 'litepub:oauthRegistrationEndpoint',
|
'oauthRegistrationEndpoint' => 'litepub:oauthRegistrationEndpoint',
|
||||||
'sensitive' => 'as:sensitive',
|
'sensitive' => 'as:sensitive',
|
||||||
|
@ -4583,7 +4593,7 @@ class Activity
|
||||||
'Hashtag' => 'as:Hashtag',
|
'Hashtag' => 'as:Hashtag',
|
||||||
'canReply' => 'toot:canReply',
|
'canReply' => 'toot:canReply',
|
||||||
'approval' => 'toot:approval',
|
'approval' => 'toot:approval',
|
||||||
'Identity' => 'nomad:Identity',
|
'Identity' => 'fep:Identity',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue