From: Hypolite Petovan Date: Wed, 11 Dec 2019 08:29:57 +0000 (-0500) Subject: Add Mastodon API entity Relationship class X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=771658391218184966182fcb49669cc239eb5862;p=friendica.git Add Mastodon API entity Relationship class --- diff --git a/src/Api/Mastodon/Relationship.php b/src/Api/Mastodon/Relationship.php new file mode 100644 index 0000000000..18e249ba3e --- /dev/null +++ b/src/Api/Mastodon/Relationship.php @@ -0,0 +1,59 @@ +id = $contact['id']; + $relationship->following = in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND]); + $relationship->followed_by = in_array($contact['rel'], [Contact::FOLLOWER, Contact::FRIEND]); + $relationship->blocking = (bool)$contact['blocked']; + $relationship->muting = (bool)$contact['readonly']; + $relationship->muting_notifications = (bool)$contact['readonly']; + $relationship->requested = (bool)$contact['pending']; + $relationship->domain_blocking = Network::isUrlBlocked($contact['url']); + // Unsupported + $relationship->showing_reblogs = true; + // Unsupported + $relationship->endorsed = false; + + return $relationship; + } +}