- // If it is a friend suggestion, the contact is not a new friend but an existing friend
- // that should not be deleted.
-
- $fid = $intro['fid'];
-
- if ($_POST['submit'] == L10n::t('Discard')) {
- DBA::delete('intro', ['id' => $intro_id]);
- if (!$fid) {
- // The check for pending is in case the friendship was already approved
- // and we just want to get rid of the pending contact
- $condition = ['id' => $contact_id, 'uid' => local_user(),
- 'self' => false, 'pending' => true, 'rel' => Contact::FOLLOWER];
- if (DBA::exists('contact', $condition)) {
- Contact::remove($contact_id);
- }
- }
- $a->internalRedirect('notifications/intros');
- }
-
- if ($_POST['submit'] == L10n::t('Ignore')) {
- DBA::update('intro', ['ignore' => true], ['id' => $intro_id]);
- $a->internalRedirect('notifications/intros');
- }