mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 16:44:50 +00:00
commit
684785500a
4 changed files with 80 additions and 1 deletions
|
@ -3010,9 +3010,10 @@ class ApiV1Controller extends Controller
|
||||||
$status->caption = $content;
|
$status->caption = $content;
|
||||||
$status->rendered = $rendered;
|
$status->rendered = $rendered;
|
||||||
$status->profile_id = $user->profile_id;
|
$status->profile_id = $user->profile_id;
|
||||||
$status->scope = 'draft';
|
|
||||||
$status->is_nsfw = $cw;
|
$status->is_nsfw = $cw;
|
||||||
$status->cw_summary = $spoilerText;
|
$status->cw_summary = $spoilerText;
|
||||||
|
$status->scope = 'draft';
|
||||||
|
$status->visibility = 'draft';
|
||||||
if($request->has('place_id')) {
|
if($request->has('place_id')) {
|
||||||
$status->place_id = $request->input('place_id');
|
$status->place_id = $request->input('place_id');
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,6 +561,7 @@ class ComposeController extends Controller
|
||||||
$status->caption = strip_tags($request->caption);
|
$status->caption = strip_tags($request->caption);
|
||||||
$status->rendered = Autolink::create()->autolink($status->caption);
|
$status->rendered = Autolink::create()->autolink($status->caption);
|
||||||
$status->scope = 'draft';
|
$status->scope = 'draft';
|
||||||
|
$status->visibility = 'draft';
|
||||||
$status->profile_id = $profile->id;
|
$status->profile_id = $profile->id;
|
||||||
$status->save();
|
$status->save();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
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'),
|
'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'),
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -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
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue