Added "collapsed" list

This commit is contained in:
Michael 2023-01-08 18:28:19 +00:00
parent 50746bad55
commit 480d9f53c3
2 changed files with 20 additions and 5 deletions

View File

@ -247,6 +247,11 @@ class Contact extends BaseModule
// This makes the query look for contact.uid = 0 // This makes the query look for contact.uid = 0
array_unshift($sql_values, 0); array_unshift($sql_values, 0);
break; break;
case 'collapsed':
$sql_extra = " AND `id` IN (SELECT `cid` FROM `user-contact` WHERE `user-contact`.`uid` = ? AND `user-contact`.`collapsed`)";
// This makes the query look for contact.uid = 0
array_unshift($sql_values, 0);
break;
case 'archived': case 'archived':
$sql_extra = " AND `archive` AND NOT `blocked` AND NOT `pending`"; $sql_extra = " AND `archive` AND NOT `blocked` AND NOT `pending`";
break; break;
@ -362,6 +367,14 @@ class Contact extends BaseModule
'id' => 'showignored-tab', 'id' => 'showignored-tab',
'accesskey' => 'i', 'accesskey' => 'i',
], ],
[
'label' => DI::l10n()->t('Collapsed'),
'url' => 'contact/collapsed',
'sel' => $type == 'collapsed' ? 'active' : '',
'title' => DI::l10n()->t('Only show collapsed contacts'),
'id' => 'showcollapsed-tab',
'accesskey' => 'c',
],
[ [
'label' => DI::l10n()->t('Archived'), 'label' => DI::l10n()->t('Archived'),
'url' => 'contact/archived', 'url' => 'contact/archived',
@ -403,6 +416,7 @@ class Contact extends BaseModule
case 'blocked': $header .= ' - ' . DI::l10n()->t('Blocked'); break; case 'blocked': $header .= ' - ' . DI::l10n()->t('Blocked'); break;
case 'hidden': $header .= ' - ' . DI::l10n()->t('Hidden'); break; case 'hidden': $header .= ' - ' . DI::l10n()->t('Hidden'); break;
case 'ignored': $header .= ' - ' . DI::l10n()->t('Ignored'); break; case 'ignored': $header .= ' - ' . DI::l10n()->t('Ignored'); break;
case 'collapsed': $header .= ' - ' . DI::l10n()->t('collapsed'); break;
case 'archived': $header .= ' - ' . DI::l10n()->t('Archived'); break; case 'archived': $header .= ' - ' . DI::l10n()->t('Archived'); break;
} }

View File

@ -401,6 +401,7 @@ return [
'/hidden' => [Module\Contact::class, [R::GET]], '/hidden' => [Module\Contact::class, [R::GET]],
'/hovercard' => [Module\Contact\Hovercard::class, [R::GET]], '/hovercard' => [Module\Contact\Hovercard::class, [R::GET]],
'/ignored' => [Module\Contact::class, [R::GET]], '/ignored' => [Module\Contact::class, [R::GET]],
'/collapsed' => [Module\Contact::class, [R::GET]],
'/match' => [Module\Contact\MatchInterests::class, [R::GET]], '/match' => [Module\Contact\MatchInterests::class, [R::GET]],
'/pending' => [Module\Contact::class, [R::GET]], '/pending' => [Module\Contact::class, [R::GET]],
'/redir/{id:\d+}' => [Module\Contact\Redir::class, [R::GET]], '/redir/{id:\d+}' => [Module\Contact\Redir::class, [R::GET]],