? 308585_comment_notify_pgsql_compliance.patch
? 308585_comment_notify_pgsql_compliance_4.patch
? 317640_6x_drop_notify_column.patch
? general.pot
Index: comment_notify.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_notify/comment_notify.install,v
retrieving revision 1.6
diff -u -p -r1.6 comment_notify.install
--- comment_notify.install	22 Aug 2008 01:18:03 -0000	1.6
+++ comment_notify.install	8 Oct 2008 17:07:35 -0000
@@ -55,4 +55,14 @@ function comment_notify_schema() {
 function comment_notify_update_6000() {
   $return[] = update_sql("DELETE FROM {comment_notify} WHERE cid NOT IN (SELECT cid FROM {comments})");
   return $return;
-}
\ No newline at end of file
+}
+
+/**
+ * Drop this column from the shema.
+ */
+function comment_notify_update_6001() {
+  if (db_column_exists('comments', 'notify')) {
+    $return[] = update_sql("ALTER TABLE {comments} DROP notify");
+    return $return;
+  }
+}
Index: comment_notify.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_notify/comment_notify.module,v
retrieving revision 1.30
diff -u -p -r1.30 comment_notify.module
--- comment_notify.module	8 Oct 2008 16:28:10 -0000	1.30
+++ comment_notify.module	8 Oct 2008 17:07:36 -0000
@@ -346,6 +346,9 @@ function _comment_notify_mailalert($comm
   $sent_to = array();
   $subject = t('!site :: new comment for your post.', array('!site' => variable_get('site_name', 'drupal')));
 
+<<<<<<< comment_notify.module
+  $result = db_query("SELECT DISTINCT c.cid, u.init, c.uid, c.name, c.nid, c.mail AS cmail, u.mail AS umail, u.init uinit, c.uid, c.name, cn.notify_hash mymd5, u.status AS u_status
+=======
   // Send to a subscribed author if they are not the current commenter
   $author = user_load(array('uid' => $node->uid));
   if ($author->node_notify_mailalert == 1 && $user->mail != $author->mail) {
@@ -375,15 +378,73 @@ function _comment_notify_mailalert($comm
  
   //Get the list of commenters to notify
   $result = db_query("SELECT DISTINCT c.cid, c.uid, c.name, c.nid, c.mail AS cmail, u.mail AS umail, u.init AS uinit, c.uid, c.name, cn.notify, cn.notify_hash
+>>>>>>> 1.30
     FROM {comments} c INNER JOIN {comment_notify} cn on c.cid = cn.cid LEFT OUTER JOIN {users} u ON c.uid = u.uid
+<<<<<<< comment_notify.module
+    WHERE nid = %d  AND cn.notify = 1 AND c.status = 0", $nid
+=======
     WHERE nid = %d AND cn.notify > 0 AND c.status = 0 AND (u.status = 1 OR u.uid = 0)", $nid
+>>>>>>> 1.30
   );
   // TODO? the original big query had stuff making sure the mail was populated and contained .+@.+ Perhaps check for that here and set notify = 0 if that is the case for this cid
+  // TODO: this query also used to only allow in users who were active or who were anonymous, but that's moved to php in the loop which may be less efficient but is more cross db compatible...
 
   while ($alert = db_fetch_object($result)) {
-    $umail = empty($alert->umail) ? $alert->uinit : $alert->umail;
-    $mail = empty($alert->cmail) ? $umail : $alert->cmail;
-
+    if (!$alert->u_status === 0) {
+      $umail = empty($alert->umail) ? $alert->uinit : $alert->umail;
+      $mail = empty($alert->cmail) ? $umail : $alert->cmail;
+
+      if ($mail != $comment_mail && !in_array($mail, $sent_to) && $alert->uid != $comment->uid) {
+        $message = array();
+        if (!empty($alert->uid)) {
+          $recipient_user = user_load(array('uid' => $alert->uid));
+          $language = user_preferred_language($recipient_user);
+        }
+        else {
+          $language = language_default();
+        }
+
+        $message['subject'] = t('!site :: new comment for your post.', array('!site' => variable_get('site_name', 'drupal')));
+        $message['body'] = t(
+          variable_get('comment_notify_default_mailtext', DEFAULT_MAILTEXT),
+          array(
+            '!commname' => $comment->name,
+            '!commtext' => $comment->comment,
+            '!commsubj' => $comment->subject,
+            '!comment_url' => url('node/'. $nid, array('absolute' => TRUE)) .'#comment-'. $cid,
+            '!node_title' =>  $node->title,
+            '!node_teaser' => $node->teaser,
+            '!mission' => variable_get('site_mission', ''),
+            '!node_body' =>  $node->body,
+            '!name' => $alert->name,
+            '!site' => variable_get('site_name', 'drupal'),
+            '!uri' => $base_url,
+            '!uri_brief' => drupal_substr($base_url, drupal_strlen('http://')),
+            '!date' => format_date(time()),
+            '!login_uri' => url('user', array('absolute' => TRUE)),
+            '!edit_uri' => url('user/'. $alert->uid .'/edit', array('absolute' => TRUE)),
+            '!link1' => url('comment_notify/disable/'. $alert->mymd5, array('absolute' => TRUE))
+          )
+        );
+        drupal_mail('comment_notify', 'comment_notify_mail', $mail, $language, $message);
+        $count++;
+        $sent_to[] = $mail;
+
+        if ($alert->uid != 0) {
+          $watchdog_message = 'Notified: <a href="!url">@user_mail</a>';
+        }
+        else {
+          $watchdog_message = 'Notified @user_mail';
+        }
+
+        // Add an entry to the watchdog log.
+        watchdog('comment_notify', $watchdog_message, array('!url' => url('user/'. $alert->uid .'/edit'), '@user_mail' => $mail),
+          WATCHDOG_NOTICE, l(t('source comment'), 'node/'. $nid, array('fragment' => 'comment-'. $alert->cid)));
+
+<<<<<<< comment_notify.module
+        // revert to previous (site default) locale
+        $language = $initial_language;
+=======
     if ($alert->notify == COMMENT_NOTIFY_COMMENT && $alert->cid != $comment->pid) {
       break;
     }
@@ -393,7 +454,10 @@ function _comment_notify_mailalert($comm
       if (!empty($alert->uid)) {
         $recipient_user = user_load(array('uid' => $alert->uid));
         $language = user_preferred_language($recipient_user);
+>>>>>>> 1.30
       }
+<<<<<<< comment_notify.module
+=======
       else {
         $language = language_default();
       }
@@ -437,6 +501,7 @@ function _comment_notify_mailalert($comm
 
       // revert to previous (site default) locale
       $language = $initial_language;
+>>>>>>> 1.30
     }
   }
 }
