aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Model/FetchableModel.php
diff options
context:
space:
mode:
authorwinter2024-12-19 20:59:18 +0000
committerwinter2024-12-19 20:59:18 +0000
commit72b07245f44c73ed41bfcca2465a9ee34426a922 (patch)
tree57372703100ad792c95c665a568aabe8a763bfdf /Digitigrade/Model/FetchableModel.php
parent1e070a7a0097c74f8ac30678d39267f19c76f9f6 (diff)
implement follow relationships (untested)
does NOT implement the actual behaviour behind follows (receiving posts and such)
Diffstat (limited to 'Digitigrade/Model/FetchableModel.php')
-rw-r--r--Digitigrade/Model/FetchableModel.php6
1 files changed, 3 insertions, 3 deletions
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;