From 73f7b5c755060c7c4f43b8770fb767b618e7cd7b Mon Sep 17 00:00:00 2001 From: swentel Date: Tue, 6 Nov 2018 00:48:59 +0100 Subject: [PATCH] Allow follow-of --- README.md | 2 ++ lib/XRay/Formats/Mf2.php | 2 +- lib/XRay/PostType.php | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 326519d..732d575 100644 --- a/README.md +++ b/README.md @@ -384,6 +384,7 @@ If a property supports multiple values, it will always be returned as an array. * `like-of` * `repost-of` * `bookmark-of` +* `follow-of` * `syndication` * `photo` (of an entry, not of a card) * `video` @@ -416,6 +417,7 @@ The following post types are returned, which are slightly expanded from what is * `photo` * `article` * `note` +* `follow` #### Other Properties diff --git a/lib/XRay/Formats/Mf2.php b/lib/XRay/Formats/Mf2.php index 7023f1b..2ad8315 100644 --- a/lib/XRay/Formats/Mf2.php +++ b/lib/XRay/Formats/Mf2.php @@ -429,7 +429,7 @@ class Mf2 extends Format { // These properties are always returned as arrays and always URLs // If the value is an h-* object with a URL, the URL is used and a "ref" is added as well - self::collectArrayURLValues(['photo','video','audio','syndication','in-reply-to','like-of','repost-of','bookmark-of','quotation-of'], $item, $data, $refs, $http); + self::collectArrayURLValues(['photo','video','audio','syndication','in-reply-to','like-of','repost-of','bookmark-of','quotation-of','follow-of'], $item, $data, $refs, $http); // Hack to make quotation-of a single value if(isset($data['quotation-of'])) diff --git a/lib/XRay/PostType.php b/lib/XRay/PostType.php index 9d2e186..0747b6d 100644 --- a/lib/XRay/PostType.php +++ b/lib/XRay/PostType.php @@ -38,6 +38,9 @@ class PostType { if(isset($post['photo'])) return 'photo'; + if(isset($post['follow-of'])) + return 'follow'; + $content = ''; if(isset($post['content'])) $content = $post['content']['text'];