From 1685f4f0caa3c64b4919b7005950aa4ee8d4fc29 Mon Sep 17 00:00:00 2001 From: winter Date: Mon, 10 Mar 2025 20:29:54 +0000 Subject: send new follow status in follow endpoint to mitigate desynchronisation issues, which could otherwise cause one instance to think its request is pending while the other instance thinks it's active --- Digitigrade/Model/Actor.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Digitigrade/Model/Actor.php') diff --git a/Digitigrade/Model/Actor.php b/Digitigrade/Model/Actor.php index 2b9a867..229582c 100644 --- a/Digitigrade/Model/Actor.php +++ b/Digitigrade/Model/Actor.php @@ -153,6 +153,9 @@ class Actor extends PushableModel implements RpcReceiver { switch ($method) { case 'follow': $status = $this->requestToFollow ? FollowRelationStatus::PENDING : FollowRelationStatus::ACTIVE; + if (strlen(trim($result->body)) > 0) { // remote server returned new status, use that instead + $status = FollowRelationStatus::tryFrom(trim($result->body)) ?? $status; + } $rel = FollowRelation::create($args[0], $this, $status); $rel->processNotifications(); return $status; -- cgit v1.3