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:
bsitu 2014-08-26 13:07:11 -07:00
parent f9701b360f
commit 17828f7953

View file

@ -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;
}