mirror of
https://github.com/friendica/friendica
synced 2025-04-25 02:30:11 +00:00
Issue 13910: Display the unseen counter based on the channel
This commit is contained in:
parent
0ccb3e7efe
commit
618a3153ab
7 changed files with 107 additions and 47 deletions
|
@ -235,6 +235,7 @@ class Timeline extends BaseModule
|
|||
protected function getChannelItems(array $request)
|
||||
{
|
||||
$items = $this->getRawChannelItems($request);
|
||||
$total = min(count($items), $this->itemsPerPage);
|
||||
|
||||
$contacts = $this->database->selectToArray('user-contact', ['cid'], ['channel-frequency' => Contact\User::FREQUENCY_REDUCED, 'cid' => array_column($items, 'owner-id')]);
|
||||
$reduced = array_column($contacts, 'cid');
|
||||
|
@ -246,8 +247,8 @@ class Timeline extends BaseModule
|
|||
$owner_posts = [];
|
||||
$selected_items = [];
|
||||
|
||||
while (count($selected_items) < $this->itemsPerPage && ++$count < 50 && count($items) > 0) {
|
||||
$maxposts = round((count($items) / $this->itemsPerPage) * $maxpostperauthor);
|
||||
while (count($selected_items) < $total && ++$count < 50 && count($items) > 0) {
|
||||
$maxposts = round((count($items) / $total) * $maxpostperauthor);
|
||||
$minId = $items[array_key_first($items)][$this->order];
|
||||
$maxId = $items[array_key_last($items)][$this->order];
|
||||
|
||||
|
@ -279,7 +280,7 @@ class Timeline extends BaseModule
|
|||
$this->maxId = $maxId;
|
||||
}
|
||||
|
||||
if (count($selected_items) < $this->itemsPerPage) {
|
||||
if (count($selected_items) < $total) {
|
||||
$items = $this->getRawChannelItems($request);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue