From: Hypolite Petovan Date: Sat, 4 Aug 2018 19:40:45 +0000 (+0200) Subject: Add CW support to shared posts in Protocol\OStatus X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c9b756674a08ad45e8494e2b2ae40622f215ad78;p=friendica.git Add CW support to shared posts in Protocol\OStatus --- diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index bf1ff68a11..9b3af22904 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -1042,6 +1042,14 @@ class OStatus $item["object-type"] = XML::getFirstNodeValue($xpath, 'activity:object-type/text()', $activityobject); + // Mastodon Content Warning + if (($item["verb"] == ACTIVITY_POST) && $xpath->evaluate('boolean(atom:summary)', $activityobject)) { + $clear_text = XML::getFirstNodeValue($xpath, 'atom:summary/text()', $activityobject); + if (!empty($clear_text)) { + $item['content-warning'] = HTML::toBBCode($clear_text); + } + } + $inreplyto = $xpath->query('thr:in-reply-to', $activityobject); if (is_object($inreplyto->item(0))) { foreach ($inreplyto->item(0)->attributes as $attributes) {