瀏覽代碼

Merge pull request #2543 from pixelfed/staging

Update StatusController, fix scope bug
daniel 4 年之前
父節點
當前提交
2463d6542e

+ 1 - 0
CHANGELOG.md

@@ -151,6 +151,7 @@
 - Updated StatusService, cast response to array. ([0fbde91e](https://github.com/pixelfed/pixelfed/commit/0fbde91e))
 - Updated status model, use scope over deprecated visibility attribute. ([f70826e1](https://github.com/pixelfed/pixelfed/commit/f70826e1))
 - Updated Follower model, increase hourly limit from 30 to 150. ([b9b84e6f](https://github.com/pixelfed/pixelfed/commit/b9b84e6f))
+- Updated StatusController, fix scope bug. ([7dc3739c](https://github.com/pixelfed/pixelfed/commit/7dc3739c))
 
 ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
 ### Added

+ 1 - 1
app/Http/Controllers/StatusController.php

@@ -33,7 +33,7 @@ class StatusController extends Controller
 
         $status = Status::whereProfileId($user->id)
                 ->whereNull('reblog_of_id')
-                ->whereIn('scope', ['public','unlisted'])
+                ->whereIn('scope', ['public','unlisted', 'private'])
                 ->findOrFail($id);
 
         if($status->uri || $status->url) {

+ 34 - 0
database/migrations/2020_12_27_040951_add_skip_optimize_to_media_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddSkipOptimizeToMediaTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('media', function (Blueprint $table) {
+            $table->boolean('skip_optimize')->nullable()->index();
+            $table->timestamp('replicated_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('media', function (Blueprint $table) {
+            $table->dropColumn('skip_optimize');
+            $table->dropColumn('replicated_at');
+        });
+    }
+}