]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #8147 from annando/fetch-post
authorPhilipp <admin+Github@philipp.info>
Mon, 20 Jan 2020 22:51:07 +0000 (23:51 +0100)
committerGitHub <noreply@github.com>
Mon, 20 Jan 2020 22:51:07 +0000 (23:51 +0100)
Fix for AP posts where the URL don't match

1  2 
src/Model/Item.php

diff --combined src/Model/Item.php
index 38557c52cea7f5e60f7b568bea5cc4138cc2e390,41c6eeb94dba76d4adc8f03c5640d50697da7184..47af3d5a69b9e2afdf9a004c9b40fc9638a6dd42
@@@ -1856,18 -1856,7 +1856,18 @@@ class Ite
                }
  
                // Creates or assigns the permission set
 -              $item['psid'] = PermissionSet::fetchIDForPost($item);
 +              $item['psid'] = PermissionSet::getIdFromACL(
 +                      $item['uid'],
 +                      $item['allow_cid'],
 +                      $item['allow_gid'],
 +                      $item['deny_cid'],
 +                      $item['deny_gid']
 +              );
 +
 +              $item['allow_cid'] = null;
 +              $item['allow_gid'] = null;
 +              $item['deny_cid'] = null;
 +              $item['deny_gid'] = null;
  
                // We are doing this outside of the transaction to avoid timing problems
                if (!self::insertActivity($item)) {
  
                $private = ($user['allow_cid'] || $user['allow_gid'] || $user['deny_cid'] || $user['deny_gid']) ? 1 : 0;
  
 -              $psid = PermissionSet::fetchIDForPost($user);
 +              $psid = PermissionSet::getIdFromACL(
 +                      $user['uid'],
 +                      $user['allow_cid'],
 +                      $user['allow_gid'],
 +                      $user['deny_cid'],
 +                      $user['deny_gid']
 +              );
  
                $forum_mode = ($prvgroup ? 2 : 1);
  
                        return $item_id;
                }
  
-               if (ActivityPub\Processor::fetchMissingActivity($uri)) {
-                       $item_id = self::searchByLink($uri, $uid);
+               if ($fetched_uri = ActivityPub\Processor::fetchMissingActivity($uri)) {
+                       $item_id = self::searchByLink($fetched_uri, $uid);
                } else {
                        $item_id = Diaspora::fetchByURL($uri);
                }