浏览代码

Merge pull request #1600 from pixelfed/frontend-ui-refactor

Frontend ui refactor
daniel 5 年之前
父节点
当前提交
2018234817
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      app/Jobs/StatusPipeline/StatusDelete.php
  2. 4 4
      app/Util/ActivityPub/Inbox.php

+ 1 - 1
app/Jobs/StatusPipeline/StatusDelete.php

@@ -104,7 +104,7 @@ class StatusDelete implements ShouldQueue
             Report::whereObjectType('App\Status')
                 ->whereObjectId($status->id)
                 ->delete();
-            $status->delete();
+            $status->forceDelete();
         });
 
         return true;

+ 4 - 4
app/Util/ActivityPub/Inbox.php

@@ -274,10 +274,10 @@ class Inbox
             return;
         }
 
-        $follower = new Follower();
-        $follower->profile_id = $actor->id;
-        $follower->following_id = $target->id;
-        $follower->save();
+        $follower = Follower::firstOrCreate([
+            'profile_id' => $actor->id,
+            'following_id' => $target->id,
+        ]);
         FollowPipeline::dispatch($follower);
 
         $request->delete();