瀏覽代碼

Update ActivityPub Inbox

Daniel Supernault 6 年之前
父節點
當前提交
77c056e93b
共有 1 個文件被更改,包括 11 次插入12 次删除
  1. 11 12
      app/Util/ActivityPub/Inbox.php

+ 11 - 12
app/Util/ActivityPub/Inbox.php

@@ -185,19 +185,18 @@ class Inbox
                 'following_id' => $target->id,
                 'local_profile' => empty($actor->domain)
             ]);
-            if($follower->wasRecentlyCreated == false) {
-                return;
+            if($follower->wasRecentlyCreated == true) {
+                // send notification
+                Notification::firstOrCreate([
+                    'profile_id' => $target->id,
+                    'actor_id' => $actor->id,
+                    'action' => 'follow',
+                    'message' => $follower->toText(),
+                    'rendered' => $follower->toHtml(),
+                    'item_id' => $target->id,
+                    'item_type' => 'App\Profile'
+                ]);
             }
-            // send notification
-            Notification::firstOrCreate([
-                'profile_id' => $target->id,
-                'actor_id' => $actor->id,
-                'action' => 'follow',
-                'message' => $follower->toText(),
-                'rendered' => $follower->toHtml(),
-                'item_id' => $target->id,
-                'item_type' => 'App\Profile'
-            ]);
 
             // send Accept to remote profile
             $accept = [