]> git.mxchange.org Git - friendica.git/commitdiff
Change selectOriginal post to return earliest post from non-0 user
authorHank Grabowski <hankgrabowski@gmail.com>
Mon, 29 May 2023 18:03:16 +0000 (14:03 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 26 Jul 2023 17:12:23 +0000 (19:12 +0200)
  I believe the earliest entry not being uid=0 should be the original post of a reshared post

src/Model/Post.php

index 770ab083178f41b3ee8d3a14021bbb433581ca33..9e137ae379496f54895ee79e372aad8be4baf011 100644 (file)
@@ -263,7 +263,10 @@ class Post
                        return $result;
                }
 
-               return self::selectFirst($original_fields, ['uri-id' => $result['thr-parent-id'], 'uid' => [0, $result['uid']]], $params);
+               $final_query_condition = ['uri-id' => $result['thr-parent-id']];
+               $final_query_condition = DBA::mergeConditions($final_query_condition, ['uid != 0']);
+               $final_params          = ['order' => ['id']];
+               return self::selectFirst($original_fields, $final_query_condition, $final_params);
        }
 
        /**