]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
logging and checking
authorEvan Prodromou <evan@prodromou.name>
Mon, 21 Jul 2008 09:28:13 +0000 (05:28 -0400)
committerEvan Prodromou <evan@prodromou.name>
Mon, 21 Jul 2008 09:28:13 +0000 (05:28 -0400)
darcs-hash:20080721092813-84dde-ac19bbdd85bbf796ecf8ffbc8c0cb05d0d1667ab.gz

lib/mail.php

index c9c59db35b448a301d293d7223947de4e0ee2694..2f4f502d47c9761904766d891077560f9557c1ff 100644 (file)
@@ -169,11 +169,15 @@ function mail_broadcast_notice_sms($notice) {
 
        $cnt = $user->find();
 
-       while ($user->fetch()) {
-               $success = mail_send_sms_notice($notice, $user);
-               if (!$success) {
-                       common_log(LOG_ERR, 'Could not send SMS message to user', __FILE__);
-                       return false;
+       common_log(LOG_INFO, "Sending notice " . $notice->id . " to $cnt subscribers", __FILE__);
+       
+       if ($cnt) {
+               while ($user->fetch()) {
+                       $success = mail_send_sms_notice($notice, $user);
+                       if (!$success) {
+                               common_log(LOG_ERR, 'Could not send SMS message to user', __FILE__);
+                               return false;
+                       }
                }
        }
        
@@ -186,6 +190,8 @@ function mail_send_sms_notice($notice, $user) {
        $to = $name . ' <' . $user->smsemail . '>';
        $other = $notice->getProfile();
 
+       common_log(LOG_INFO, "Sending notice " . $notice->id . " to " . $user->smsemail, __FILE__);
+       
        $headers = array();
        $headers['From'] = $user->incomingemail;
        $headers['To'] = $to;