From ada5c4cc6a84e2b62da32346216fa2738c418989 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 10 Apr 2017 00:57:36 -0400 Subject: [PATCH] Add Content Warning support for comments too Doh! --- include/ostatus.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/ostatus.php b/include/ostatus.php index 73fcb47572..9c1246c85c 100644 --- a/include/ostatus.php +++ b/include/ostatus.php @@ -354,8 +354,9 @@ class ostatus { } $item["object-type"] = $xpath->query('activity:object-type/text()', $entry)->item(0)->nodeValue; + $item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue; - if ($item["object-type"] == ACTIVITY_OBJ_NOTE && $xpath->evaluate('boolean(atom:summary)', $entry)) { + if ($item["verb"] == ACTIVITY_POST && $xpath->evaluate('boolean(atom:summary)', $entry)) { // Mastodon Content Warning $clear_text = $xpath->query('atom:summary/text()', $entry)->item(0)->nodeValue; $hidden_text = $xpath->query('atom:content/text()', $entry)->item(0)->nodeValue; @@ -370,7 +371,7 @@ class ostatus { $item["body"] = add_page_info_to_body(html2bbcode($xpath->query('atom:content/text()', $entry)->item(0)->nodeValue)); } $item["object"] = $xml; - $item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue; + /// @TODO /// Delete a message