]> git.mxchange.org Git - friendica.git/commitdiff
Store the direction only when there is content to store
authorMichael <heluecht@pirati.ca>
Tue, 3 Mar 2020 08:04:14 +0000 (08:04 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 3 Mar 2020 08:04:14 +0000 (08:04 +0000)
src/Protocol/ActivityPub/Processor.php

index e79fcaff68182ddf77c21d9a176dcc4000a0d3e9..14b993e6e2aaeeea0091eaffe9c2364082212fb6 100644 (file)
@@ -461,6 +461,10 @@ class Processor
                        $item['protocol'] = Conversation::PARCEL_ACTIVITYPUB;
                        $item['conversation-href'] = $activity['context'] ?? '';
                        $item['conversation-uri'] = $activity['conversation'] ?? '';
+                       
+                       if (isset($activity['push'])) {
+                               $item['direction'] = $activity['push'] ? Conversation::PUSH : Conversation::PULL;
+                       }       
                }
 
                $isForum = false;
@@ -489,10 +493,6 @@ class Processor
                        return;
                }
 
-               if (isset($activity['push'])) {
-                       $item['direction'] = $activity['push'] ? Conversation::PUSH : Conversation::PULL;
-               }
-
                $item['plink'] = $activity['alternate-url'] ?? $item['uri'];
 
                $item = self::constructAttachList($activity, $item);