From 72b07245f44c73ed41bfcca2465a9ee34426a922 Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 19 Dec 2024 20:59:18 +0000 Subject: implement follow relationships (untested) does NOT implement the actual behaviour behind follows (receiving posts and such) --- Digitigrade/Model/FetchableModel.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Digitigrade/Model/FetchableModel.php') diff --git a/Digitigrade/Model/FetchableModel.php b/Digitigrade/Model/FetchableModel.php index 1120823..5e4d1e8 100644 --- a/Digitigrade/Model/FetchableModel.php +++ b/Digitigrade/Model/FetchableModel.php @@ -55,10 +55,10 @@ abstract class FetchableModel extends Model implements RemoteFetchable { protected static function fetchFromRemote(string $uri, bool $autoSave): ?static { // fetch the object // janky hack: if this is an Instance then avoid recursively fetching itself - $data = @get_remote_object_authenticated($uri, static::class == Instance::class); - if ($data === false) + $result = @send_request_authenticated($uri, static::class == Instance::class); + if (!str_contains($result->headers[0], '200')) return null; - $data = json_decode($data); + $data = json_decode($result->body); if ($data === null) return null; -- cgit v1.3