aboutsummaryrefslogtreecommitdiffstats
path: root/mod/notifications.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-30 15:10:50 -0700
committerfriendica <info@friendica.com>2012-03-30 15:10:50 -0700
commitcfdfcb37cbed8354e9f6c025a6e9ccadafc2d625 (patch)
treeb143e223f2ffc2225fc95b42acc6e1997acbd764 /mod/notifications.php
parent5b4bb347a65b21c4119e22ef116b8b0aed626065 (diff)
downloadvolse-hubzilla-cfdfcb37cbed8354e9f6c025a6e9ccadafc2d625.tar.gz
volse-hubzilla-cfdfcb37cbed8354e9f6c025a6e9ccadafc2d625.tar.bz2
volse-hubzilla-cfdfcb37cbed8354e9f6c025a6e9ccadafc2d625.zip
don't delete contact from a friend request if friendship was already established
Diffstat (limited to 'mod/notifications.php')
-rwxr-xr-xmod/notifications.php6
1 files changed, 5 insertions, 1 deletions
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())
);