]> git.mxchange.org Git - friendica.git/commitdiff
don't delete contact from a friend request if friendship was already established
authorfriendica <info@friendica.com>
Fri, 30 Mar 2012 22:10:50 +0000 (15:10 -0700)
committerfriendica <info@friendica.com>
Fri, 30 Mar 2012 22:10:50 +0000 (15:10 -0700)
boot.php
mod/notifications.php

index 1f2b690773cae4318326cc24a5f862796ec56e7d..03e88101a6490232112e5bc1b403c9bcb9556c63 100755 (executable)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '2.3.1296' );
+define ( 'FRIENDICA_VERSION',      '2.3.1297' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
 define ( 'DB_UPDATE_VERSION',      1133      );
 
index 551b307dbd25fb52a1ccc1055cbfa471a302dc27..690a99562f59ba5a3517ef075f338a8b3fb56bba 100755 (executable)
@@ -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())
                                );