]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
fix banding on logo, xhtml compliant list and basic table support
[friendica.git] / include / notifier.php
index 80f0e67c71cc01ec34a70f4c252fd45f77d3c360..5de6eafd10eafb9f19b08803bb8f87b514553a9d 100644 (file)
@@ -20,6 +20,8 @@ function notifier_run($argv, $argc){
        require_once('include/items.php');
        require_once('include/bbcode.php');
 
+       load_hooks();
+
        if($argc < 3)
                return;
 
@@ -189,8 +191,8 @@ function notifier_run($argv, $argc){
                        $contacts = $r;
        }
 
-       $feed_template = load_view_file('view/atom_feed.tpl');
-       $mail_template = load_view_file('view/atom_mail.tpl');
+       $feed_template = get_markup_template('atom_feed.tpl');
+       $mail_template = get_markup_template('atom_mail.tpl');
 
        $atom = '';
        $slaps = array();
@@ -270,15 +272,20 @@ function notifier_run($argv, $argc){
 
        // If this is a public message and pubmail is set on the parent, include all your email contacts
 
-       if((! strlen($parent_item['allow_cid'])) && (! strlen($parent_item['allow_gid'])) && (! strlen($parent_item['deny_cid'])) && (! strlen($parent_item['deny_gid'])) 
-               && (intval($parent_item['pubmail']))) {
-               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
-                       intval($uid),
-                       dbesc(NETWORK_MAIL)
-               );
-               if(count($r)) {
-                       foreach($r as $rr)
-                               $recipients[] = $rr['id'];
+       $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
+
+       if(! $mail_disabled) {
+               if((! strlen($parent_item['allow_cid'])) && (! strlen($parent_item['allow_gid'])) 
+                       && (! strlen($parent_item['deny_cid'])) && (! strlen($parent_item['deny_gid'])) 
+                       && (intval($parent_item['pubmail']))) {
+                       $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
+                               intval($uid),
+                               dbesc(NETWORK_MAIL)
+                       );
+                       if(count($r)) {
+                               foreach($r as $rr)
+                                       $recipients[] = $rr['id'];
+                       }
                }
        }
 
@@ -322,6 +329,7 @@ function notifier_run($argv, $argc){
                                        }
                                        break;
                                case 'stat':
+
                                        if($followup && $contact['notify']) {
                                                logger('notifier: slapdelivery: ' . $contact['name']);
                                                $deliver_status = slapper($owner,$contact['notify'],$slap);
@@ -366,7 +374,7 @@ function notifier_run($argv, $argc){
                                        }
                                        break;
                                case 'mail':
-
+                                               
                                        // WARNING: does not currently convert to RFC2047 header encodings, etc.
 
                                        $addr = $contact['addr'];
@@ -504,6 +512,8 @@ function notifier_run($argv, $argc){
 
                if((count($r)) && (($max_allowed == 0) || (count($r) < $max_allowed))) {
 
+                       logger('pubdeliver: ' . print_r($r,true));
+
                        foreach($r as $rr) {
 
                                /* Don't deliver to folks who have already been delivered to */