From cfdfcb37cbed8354e9f6c025a6e9ccadafc2d625 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 30 Mar 2012 15:10:50 -0700 Subject: don't delete contact from a friend request if friendship was already established --- mod/notifications.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod/notifications.php') diff --git a/mod/notifications.php b/mod/notifications.php index 551b307db..690a99562 100755 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -37,7 +37,11 @@ function notifications_post(&$a) { intval($intro_id) ); if(! $fid) { - $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 LIMIT 1", + + // 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 + + $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 AND `blocked` = 1 AND `pending` = 1 LIMIT 1", intval($contact_id), intval(local_user()) ); -- cgit v1.2.3