Explorar o código

Update AP Inbox

Daniel Supernault %!s(int64=6) %!d(string=hai) anos
pai
achega
8a93ed38fa
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      app/Util/ActivityPub/Inbox.php

+ 10 - 3
app/Util/ActivityPub/Inbox.php

@@ -205,21 +205,27 @@ class Inbox
     {
         $actor = $this->actorFirstOrCreate($this->payload['actor']);
         $activity = $this->payload['object'];
+
         if(!$actor || $actor->domain == null) {
             return;
         }
+
         if(Helpers::validateLocalUrl($activity) == false) {
             return;
         }
-        $parent = Helpers::statusFirstOrFetch($activity, true);
-        if(!$parent) {
+
+        $parent = Helpers::statusFetch($activity);
+
+        if(empty($parent)) {
             return;
         }
+
         $status = Status::firstOrCreate([
             'profile_id' => $actor->id,
             'reblog_of_id' => $parent->id,
-            'type' => 'reply'
+            'type' => 'share'
         ]);
+
         Notification::firstOrCreate([
             'profile_id' => $parent->profile->id,
             'actor_id' => $actor->id,
@@ -229,6 +235,7 @@ class Inbox
             'item_id' => $parent->id,
             'item_type' => 'App\Status'
         ]);
+        
         $parent->reblogs_count = $parent->shares()->count();
         $parent->save();
     }