Merge pull request #10869 from MrPetovan/bug/10868-mastodon-api-notifications

Ignore max_id when it's 0 or less in BaseDepository->_selectByBoundaries
This commit is contained in:
Michael Vogel
2021-10-13 06:57:25 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ abstract class BaseDepository
}
}
if (isset($max_id)) {
if (isset($max_id) && $max_id > 0) {
$boundCondition = DBA::mergeConditions($boundCondition, ['`id` < ?', $max_id]);
if (!isset($min_id) && (!isset($params['order']['id']) || $params['order']['id'] === false || $params['order']['id'] === 'ASC')) {
$reverseOrder = true;

View File

@@ -124,8 +124,8 @@ class Notifications extends BaseApi
$Notifications = DI::notification()->selectByBoundaries(
$condition,
$params,
$request['min_id'] ?? null,
$request['min_id'] ?? $request['since_id'] ?? null,
$request['min_id'] ?: $request['since_id'],
$request['max_id'],
$request['limit']
);