1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Implement Fever sync

This commit is contained in:
J. King 2019-04-04 19:37:48 -04:00
parent 982f09c9aa
commit 0752e9cf3d

View file

@ -138,6 +138,12 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
// TODO: implement hot links
$out['inks'] = [];
}
if ($G['unread_item_ids']) {
$out['unread_item_ids'] = $this->getItemIds((new Context)->unread(true));
}
if ($G['saved_item_ids']) {
$out['saved_item_ids'] = $this->getItemIds((new Context)->starred(true));
}
return $out;
}
@ -262,4 +268,12 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
}
return $out;
}
protected function getItemIds(Context $c = null): array {
$out = [];
foreach (Arsse::$db->articleList(Arsse::$user->id, $c) as $r) {
$out[] = (int) $r['id'];
}
return $out;
}
}