]> git.mxchange.org Git - friendica.git/commitdiff
Added "collapsed" list
authorMichael <heluecht@pirati.ca>
Sun, 8 Jan 2023 18:28:19 +0000 (18:28 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Jan 2023 18:28:19 +0000 (18:28 +0000)
src/Module/Contact.php
static/routes.config.php

index 23a2e9c493e70e27ebbe6d3733ecf59093bb9016..7441e52bcdd2a5d7617aff8ea6e931922854c968 100644 (file)
@@ -247,6 +247,11 @@ class Contact extends BaseModule
                                // This makes the query look for contact.uid = 0
                                array_unshift($sql_values, 0);
                                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':
                                $sql_extra = " AND `archive` AND NOT `blocked` AND NOT `pending`";
                                break;
@@ -362,6 +367,14 @@ class Contact extends BaseModule
                                'id'    => 'showignored-tab',
                                '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'),
                                'url'   => 'contact/archived',
@@ -399,11 +412,12 @@ class Contact extends BaseModule
                }
 
                switch ($type) {
-                       case 'pending':  $header .= ' - ' . DI::l10n()->t('Pending'); break;
-                       case 'blocked':  $header .= ' - ' . DI::l10n()->t('Blocked'); break;
-                       case 'hidden':   $header .= ' - ' . DI::l10n()->t('Hidden'); break;
-                       case 'ignored':  $header .= ' - ' . DI::l10n()->t('Ignored'); break;
-                       case 'archived': $header .= ' - ' . DI::l10n()->t('Archived'); break;
+                       case 'pending':   $header .= ' - ' . DI::l10n()->t('Pending'); break;
+                       case 'blocked':   $header .= ' - ' . DI::l10n()->t('Blocked'); break;
+                       case 'hidden':    $header .= ' - ' . DI::l10n()->t('Hidden'); 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;
                }
 
                $header .= $nets ? ' - ' . ContactSelector::networkToName($nets) : '';
index 51030c6a70aba7f140e2f2d6006c3bae589d2b41..bc10fdac07a41e532a398b1f8edab4421d53156e 100644 (file)
@@ -401,6 +401,7 @@ return [
                '/hidden'                     => [Module\Contact::class,                [R::GET]],
                '/hovercard'                  => [Module\Contact\Hovercard::class,      [R::GET]],
                '/ignored'                    => [Module\Contact::class,                [R::GET]],
+               '/collapsed'                  => [Module\Contact::class,                [R::GET]],
                '/match'                      => [Module\Contact\MatchInterests::class, [R::GET]],
                '/pending'                    => [Module\Contact::class,                [R::GET]],
                '/redir/{id:\d+}'             => [Module\Contact\Redir::class,          [R::GET]],