Merge pull request #4341 from pixelfed/staging

Staging
pull/4352/head
daniel 2023-05-02 20:56:43 -06:00 zatwierdzone przez GitHub
commit 684785500a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 80 dodań i 1 usunięć

Wyświetl plik

@ -3010,9 +3010,10 @@ class ApiV1Controller extends Controller
$status->caption = $content;
$status->rendered = $rendered;
$status->profile_id = $user->profile_id;
$status->scope = 'draft';
$status->is_nsfw = $cw;
$status->cw_summary = $spoilerText;
$status->scope = 'draft';
$status->visibility = 'draft';
if($request->has('place_id')) {
$status->place_id = $request->input('place_id');
}

Wyświetl plik

@ -561,6 +561,7 @@ class ComposeController extends Controller
$status->caption = strip_tags($request->caption);
$status->rendered = Autolink::create()->autolink($status->caption);
$status->scope = 'draft';
$status->visibility = 'draft';
$status->profile_id = $profile->id;
$status->save();

Wyświetl plik

@ -1,6 +1,18 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Passport Guard
|--------------------------------------------------------------------------
|
| Here you may specify which authentication guard Passport will use when
| authenticating users. This value should correspond with one of your
| guards that is already present in your "auth" configuration file.
|
*/
'guard' => 'web',
/*
|--------------------------------------------------------------------------
@ -17,4 +29,33 @@ return [
'public_key' => env('PASSPORT_PUBLIC_KEY'),
/*
|--------------------------------------------------------------------------
| Client UUIDs
|--------------------------------------------------------------------------
|
| By default, Passport uses auto-incrementing primary keys when assigning
| IDs to clients. However, if Passport is installed using the provided
| --uuids switch, this will be set to "true" and UUIDs will be used.
|
*/
'client_uuids' => false,
/*
|--------------------------------------------------------------------------
| Personal Access Client
|--------------------------------------------------------------------------
|
| If you enable client hashing, you should set the personal access client
| ID and unhashed secret within your environment file. The values will
| get used while issuing fresh personal access tokens to your users.
|
*/
'personal_access_client' => [
'id' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_ID'),
'secret' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET'),
],
];

Wyświetl plik

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$type = config('database.default');
if($type === 'pgsql') {
DB::statement("ALTER TABLE statuses DROP CONSTRAINT statuses_visibility_check");
$types = ['public', 'unlisted', 'private', 'direct', 'draft'];
$result = join( ', ', array_map(function ($value){
return sprintf("'%s'::character varying", $value);
}, $types));
DB::statement("ALTER TABLE statuses ADD CONSTRAINT statuses_visibility_check CHECK (visibility::text = ANY (ARRAY[$result]::text[]))");
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};