1
1
Fork 0

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
commit e2400067a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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']
);