]> git.mxchange.org Git - friendica.git/blobdiff - mod/notifications.php
send less messages to server; remove delete option
[friendica.git] / mod / notifications.php
old mode 100755 (executable)
new mode 100644 (file)
index d478b51..b28b147
@@ -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())
                                );
@@ -143,11 +147,11 @@ function notifications_content(&$a) {
                                                '$intro_id' => $rr['intro_id'],
                                                '$madeby' => sprintf( t('suggested by %s'),$rr['name']),
                                                '$contact_id' => $rr['contact-id'],
-                                               '$photo' => ((x($rr,'fphoto')) ? $rr['fphoto'] : "images/default-profile.jpg"),
+                                               '$photo' => ((x($rr,'fphoto')) ? $rr['fphoto'] : "images/person-175.jpg"),
                                                '$fullname' => $rr['fname'],
-                                               '$url' => $rr['furl'],
+                                               '$url' => zrl($rr['furl']),
                                                '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''),
-                                               '$activity' => array('activity', t('Post a new friend activity'), 1, t('if applicable')),
+                                               '$activity' => array('activity', t('Post a new friend activity'), (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), t('if applicable')),
 
                                                '$knowyou' => $knowyou,
                                                '$approve' => t('Approve'),
@@ -191,11 +195,11 @@ function notifications_content(&$a) {
                                        '$uid' => $_SESSION['uid'],
                                        '$intro_id' => $rr['intro_id'],
                                        '$contact_id' => $rr['contact-id'],
-                                       '$photo' => ((x($rr,'photo')) ? $rr['photo'] : "images/default-profile.jpg"),
+                                       '$photo' => ((x($rr,'photo')) ? $rr['photo'] : "images/person-175.jpg"),
                                        '$fullname' => $rr['name'],
                                        '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''),
-                                       '$activity' => array('activity', t('Post a new friend activity'), 1, t('if applicable')),
-                                       '$url' => $rr['url'],
+                                       '$activity' => array('activity', t('Post a new friend activity'), (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), t('if applicable')),
+                                       '$url' => zrl($rr['url']),
                                        '$knowyou' => $knowyou,
                                        '$approve' => t('Approve'),
                                        '$note' => $rr['note'],