X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnotifications.php;h=3276e65491dc9060541c2dd3e5ca7c46569b0862;hb=5f2028b657332c7dceb1e14dc0e1cd175fc61a7c;hp=8bc9a76c388efcaef89d1c787579d6a68a047700;hpb=f0de19dd8a052b7ecf0d0cb2955ff06cbcb3a019;p=friendica.git diff --git a/mod/notifications.php b/mod/notifications.php index 8bc9a76c38..3276e65491 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -12,9 +12,11 @@ use Friendica\Core\L10n; use Friendica\Core\NotificationsManager; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\Core\Logger; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Module\Login; +use Friendica\Model\Contact; function notifications_post(App $a) { @@ -46,13 +48,14 @@ function notifications_post(App $a) if ($_POST['submit'] == L10n::t('Discard')) { DBA::delete('intro', ['id' => $intro_id]); - if (!$fid) { - // The check for blocked and pending is in case the friendship was already approved - // and we just want to get rid of the now pointless notification + // 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, 'blocked' => true, 'pending' => true]; - DBA::delete('contact', $condition); + 'self' => false, 'pending' => true, 'rel' => [0, Contact::FOLLOWER]]; + if (DBA::exists('contact', $condition)) { + Contact::remove($contact_id); + } } $a->internalRedirect('notifications/intros'); } @@ -98,9 +101,14 @@ function notifications_content(App $a) if ((($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) { Nav::setSelected('introductions'); + $id = 0; + if (!empty($a->argv[2]) && intval($a->argv[2]) != 0) { + $id = (int)$a->argv[2]; + } + $all = (($a->argc > 2) && ($a->argv[2] == 'all')); - $notifs = $nm->introNotifs($all, $startrec, $perpage); + $notifs = $nm->introNotifs($all, $startrec, $perpage, $id); // Get the network notifications } elseif (($a->argc > 1) && ($a->argv[1] == 'network')) {