]> git.mxchange.org Git - friendica.git/commitdiff
Remove user-controlled contact archival feature
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 5 Sep 2021 18:47:29 +0000 (14:47 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 5 Sep 2021 18:54:50 +0000 (14:54 -0400)
- Archival is managed at the system level for failed probing and doesn't make sense for a user to decide on it

src/Module/Contact.php
view/templates/contact_edit.tpl
view/theme/frio/templates/contact_edit.tpl
view/theme/vier/templates/contact_edit.tpl

index ae7c77d9927b0b23dc6a692529592dbacc3db774..4233be46251cd874932c807191a4a6e808e69faf 100644 (file)
@@ -79,11 +79,6 @@ class Contact extends BaseModule
                                self::ignoreContact($contact_id);
                                $count_actions++;
                        }
-                       if (!empty($_POST['contacts_batch_archive'])
-                               && self::archiveContact($contact_id, $orig_record)
-                       ) {
-                               $count_actions++;
-                       }
                        if (!empty($_POST['contacts_batch_drop'])) {
                                self::dropContact($orig_record);
                                $count_actions++;
@@ -98,8 +93,6 @@ class Contact extends BaseModule
 
        public static function post(array $parameters = [])
        {
-               $a = DI::app();
-
                if (!local_user()) {
                        return;
                }
@@ -216,23 +209,6 @@ class Contact extends BaseModule
                Model\Contact\User::setIgnored($contact_id, local_user(), $ignored);
        }
 
-       /**
-        * Toggles the archived status of a contact identified by id.
-        * If the current status isn't provided, this will always archive the contact.
-        *
-        * @param $contact_id
-        * @param $orig_record
-        * @return bool
-        * @throws \Exception
-        */
-       private static function archiveContact($contact_id, $orig_record)
-       {
-               $archived = empty($orig_record['archive']);
-               $r = DBA::update('contact', ['archive' => $archived], ['id' => $contact_id, 'uid' => local_user()]);
-
-               return DBA::isResult($r);
-       }
-
        private static function dropContact($orig_record)
        {
                $owner = Model\User::getOwnerDataById(local_user());
@@ -395,17 +371,6 @@ class Contact extends BaseModule
                                // NOTREACHED
                        }
 
-                       if ($cmd === 'archive' && ($orig_record['uid'] != 0)) {
-                               $r = self::archiveContact($contact_id, $orig_record);
-                               if ($r) {
-                                       $archived = (($orig_record['archive']) ? 0 : 1);
-                                       info((($archived) ? DI::l10n()->t('Contact has been archived') : DI::l10n()->t('Contact has been unarchived')));
-                               }
-
-                               DI::baseUrl()->redirect('contact/' . $contact_id);
-                               // NOTREACHED
-                       }
-
                        if ($cmd === 'drop' && ($orig_record['uid'] != 0)) {
                                // Check if we should do HTML-based delete confirmation
                                if (!empty($_REQUEST['confirm'])) {
@@ -845,7 +810,6 @@ class Contact extends BaseModule
                                'contacts_batch_update'  => DI::l10n()->t('Update'),
                                'contacts_batch_block'   => DI::l10n()->t('Block') . '/' . DI::l10n()->t('Unblock'),
                                'contacts_batch_ignore'  => DI::l10n()->t('Ignore') . '/' . DI::l10n()->t('Unignore'),
-                               'contacts_batch_archive' => DI::l10n()->t('Archive') . '/' . DI::l10n()->t('Unarchive'),
                                'contacts_batch_drop'    => DI::l10n()->t('Delete'),
                        ],
                        '$h_batch_actions' => DI::l10n()->t('Batch Actions'),
@@ -1128,14 +1092,6 @@ class Contact extends BaseModule
                ];
 
                if ($contact['uid'] != 0) {
-                       $contact_actions['archive'] = [
-                               'label' => (intval($contact['archive']) ? DI::l10n()->t('Unarchive') : DI::l10n()->t('Archive')),
-                               'url'   => 'contact/' . $contact['id'] . '/archive',
-                               'title' => DI::l10n()->t('Toggle Archive status'),
-                               'sel'   => (intval($contact['archive']) ? 'active' : ''),
-                               'id'    => 'toggle-archive',
-                       ];
-
                        $contact_actions['delete'] = [
                                'label' => DI::l10n()->t('Delete'),
                                'url'   => 'contact/' . $contact['id'] . '/drop',
index 9a5fc6172cdab58b6a9e72e1cdebed65f27584eb..f59787782645479b0e682a460d0df4afc371071c 100644 (file)
@@ -21,7 +21,6 @@
                                                        <li class="divider"></li>
                                                        <li role="menuitem"><a  href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li>
                                                        <li role="menuitem"><a  href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li>
-                                                       {{if $contact_actions.archive.url}}<li role="menuitem"><a  href="#" title="{{$contact_actions.archive.title}}" onclick="window.location.href='{{$contact_actions.archive.url}}'; return false;">{{$contact_actions.archive.label}}</a></li>{{/if}}
                                                        {{if $contact_actions.delete.url}}<li role="menuitem"><a  href="{{$contact_actions.delete.url}}" title="{{$contact_actions.delete.title}}" onclick="return confirmDelete();">{{$contact_actions.delete.label}}</a></li> {{/if}}
                                                </ul>
                                        </div>
index 4fcfc1fb7ae586cea406eba0f8baa708f930da68..91c6d26f43162491536e609ddc9cdde3d2c4a847 100644 (file)
@@ -27,7 +27,6 @@
                                                        {{/if}}
                                                        <li role="presentation"><a role="menuitem" href="{{$contact_actions.block.url}}" title="{{$contact_actions.block.title}}">{{$contact_actions.block.label}}</a></li>
                                                        <li role="presentation"><a role="menuitem" href="{{$contact_actions.ignore.url}}" title="{{$contact_actions.ignore.title}}">{{$contact_actions.ignore.label}}</a></li>
-                                                       {{if $contact_actions.archive.url}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.archive.url}}" title="{{$contact_actions.archive.title}}">{{$contact_actions.archive.label}}</a></li>{{/if}}
                                                        {{if $contact_actions.delete.url}}<li role="presentation"><button role="menuitem" type="button" class="btn-link" title="{{$contact_actions.delete.title}}" onclick="addToModal('{{$contact_actions.delete.url}}?confirm=1');">{{$contact_actions.delete.label}}</button></li>{{/if}}
                                                </ul>
                                        </li>
index 94c753c7d4b53836ef25486407b63b2e3e7e763b..2693012bff36696eb0e504ca7d99f2d143fe03c3 100644 (file)
@@ -22,7 +22,6 @@
                                                        <li class="divider"></li>
                                                        <li role="menuitem"><a  href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li>
                                                        <li role="menuitem"><a  href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li>
-                                                       {{if $contact_actions.archive.url}}<li role="menuitem"><a  href="#" title="{{$contact_actions.archive.title}}" onclick="window.location.href='{{$contact_actions.archive.url}}'; return false;">{{$contact_actions.archive.label}}</a></li>{{/if}}
                                                        {{if $contact_actions.delete.url}}<li role="menuitem"><a  href="{{$contact_actions.delete.url}}" title="{{$contact_actions.delete.title}}" onclick="return confirmDelete();">{{$contact_actions.delete.label}}</a></li>{{/if}}
                                                </ul>
                                        </div>