bug fix
This commit is contained in:
parent
44cf0544e0
commit
c556441b4c
@ -173,7 +173,7 @@ class APOutboxController extends Controller
|
||||
"object" => $object_actor->id,
|
||||
]);
|
||||
|
||||
if ($response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
if (!$response || $response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
return response ()->json ([ "error" => "failed to post activity" ], 500);
|
||||
|
||||
return [
|
||||
@ -197,7 +197,7 @@ class APOutboxController extends Controller
|
||||
$unfollow_activity = TypeActivity::craft_undo ($follow_activity, $user->actor ()->first ());
|
||||
$response = TypeActivity::post_activity ($unfollow_activity, $user->actor ()->first (), $object_actor);
|
||||
|
||||
if ($response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
if (!$response || $response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
return response ()->json ([ "error" => "failed to post activity" ], 500);
|
||||
|
||||
$follow_activity->delete ();
|
||||
@ -243,7 +243,7 @@ class APOutboxController extends Controller
|
||||
|
||||
$response = TypeActivity::post_activity ($like_activity, $actor, $object->get_actor ()->first ());
|
||||
|
||||
if ($response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
if (!$response || $response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
return response ()->json ([ "error" => "failed to post activity" ], 500);
|
||||
|
||||
return [
|
||||
|
@ -58,7 +58,7 @@ class HomeController extends Controller
|
||||
if (!$actor)
|
||||
return redirect ()->route ("home");
|
||||
|
||||
return redirect ()->route ("users.show", "@$actor->preferredUsername@$domain");
|
||||
return redirect ()->route ("users.show", "@$username@$domain");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,8 +269,11 @@ class TypeActivity {
|
||||
$instances = Instance::all ();
|
||||
foreach ($instances as $instance)
|
||||
{
|
||||
if (!$instance->inbox)
|
||||
continue;
|
||||
|
||||
$response = TypeActivity::post_activity ($activity, $source, $instance->inbox, true);
|
||||
if ($response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
if (!$response || $response->getStatusCode () < 200 || $response->getStatusCode () >= 300)
|
||||
{
|
||||
Log::info ("failed to post activity to " . $instance->inbox);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ class TypeActor {
|
||||
$actor->public_key = $request['publicKey']['publicKeyPem'] ?? '';
|
||||
|
||||
$instances = Instance::where ("inbox", $actor->sharedInbox);
|
||||
if (!$instances->first ())
|
||||
if (!$instances->first () && $actor->sharedInbox)
|
||||
{
|
||||
$instance = new Instance ();
|
||||
$instance->inbox = $actor->sharedInbox;
|
||||
|
Loading…
x
Reference in New Issue
Block a user