Update ApiV1Controller, fixes #2112

This commit is contained in:
Daniel Supernault 2020-04-16 15:07:46 -06:00
parent 599ab152a7
commit 324ccd0ab8
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -1688,8 +1688,8 @@ class ApiV1Controller extends Controller
$status = new Status;
$status->caption = strip_tags($request->input('status'));
$status->scope = $request->input('visibility');
$status->visibility = $request->input('visibility');
$status->scope = $request->input('visibility', 'public');
$status->visibility = $request->input('visibility', 'public');
$status->profile_id = $user->profile_id;
$status->is_nsfw = $user->profile->cw == true ? true : $request->input('sensitive', false);
$status->in_reply_to_id = $parent->id;
@ -1723,8 +1723,8 @@ class ApiV1Controller extends Controller
abort(500, 'Invalid media ids');
}
$status->scope = $request->input('visibility');
$status->visibility = $request->input('visibility');
$status->scope = $request->input('visibility', 'public');
$status->visibility = $request->input('visibility', 'public');
$status->type = StatusController::mimeTypeCheck($mimes);
$status->save();
}
@ -1789,7 +1789,9 @@ class ApiV1Controller extends Controller
$share = Status::firstOrCreate([
'profile_id' => $user->profile_id,
'reblog_of_id' => $status->id,
'in_reply_to_profile_id' => $status->profile_id
'in_reply_to_profile_id' => $status->profile_id,
'scope' => 'public',
'visibility' => 'public'
]);
if($share->wasRecentlyCreated == true) {