]> git.mxchange.org Git - friendica.git/commitdiff
Add support for since_id field into the timeline API
authorHank Grabowski <hankgrabowski@gmail.com>
Thu, 23 Feb 2023 12:04:12 +0000 (07:04 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Thu, 23 Feb 2023 12:04:12 +0000 (07:04 -0500)
src/Module/BaseApi.php

index 5f1156d7710e49d2bb9948b16396882aab0a4509..895cff2b820bae0edd736243a9b138cf4ca5d963 100644 (file)
@@ -139,11 +139,12 @@ class BaseApi extends BaseModule
                                $condition = DBA::mergeConditions($condition, ["`$order_field` < ?", DateTimeFormat::convert($request['max_id'], DateTimeFormat::MYSQL)]);
                        }
 
+            if (!empty($request['since_id'])) {
+                $condition = DBA::mergeConditions($condition, ["`$order_field` > ?", DateTimeFormat::convert($request['since_id'], DateTimeFormat::MYSQL)]);
+            }
 
                        if (!empty($request['min_id'])) {
                                $condition = DBA::mergeConditions($condition, ["`$order_field` > ?", DateTimeFormat::convert($request['min_id'], DateTimeFormat::MYSQL)]);
-
-                               $params['order'] = [$order_field];
                        }
                }