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:
parent
982f09c9aa
commit
0752e9cf3d
1 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue