mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Continue offset is missing in the read API
When the notification is retrieved without unread first, it should have a continue offset for next batch of loading Change-Id: I101990faaf9ed3e3786805aff3906b846d62f612
This commit is contained in:
parent
f9701b360f
commit
17828f7953
|
@ -144,6 +144,14 @@ class ApiEchoNotifications extends ApiQueryBase {
|
|||
$result['list'][$notif->getEvent()->getID()] = EchoDataOutputFormatter::formatOutput( $notif, $format, $user );
|
||||
}
|
||||
|
||||
// Generate offset if necessary
|
||||
if ( !$unreadFirst ) {
|
||||
if ( count( $result['list'] ) > $limit ) {
|
||||
$lastItem = array_pop( $result['list'] );
|
||||
$result['continue'] = $lastItem['timestamp']['utcunix'] . '|' . $lastItem['id'];
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue