? 319830_settings_to_dsm.patch
Index: /Applications/MAMP/htdocs/comment_notify/drupal/sites/all/modules/comment_notify/comment_notify.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_notify/comment_notify.module,v
retrieving revision 1.8.2.22
diff -u -p -r1.8.2.22 comment_notify.module
--- comment_notify.module	24 Oct 2008 02:19:51 -0000	1.8.2.22
+++ comment_notify.module	15 Nov 2008 16:10:24 -0000
@@ -7,7 +7,6 @@
  * This module provides comment follow-up e-mail notification for anonymous and registered users.
  */
 
-
 define('AUTHOR_MAILTEXT',
 'Hi !name,
 
@@ -139,7 +138,6 @@ function comment_notify_form_alter($form
       '#title' => t('Notify me of follow-up comments posted here.'),
       '#default_value' => !empty($user->comment_notify_mailalert) ? $user->comment_notify_mailalert : variable_get('comment_notify_default_anon_mailalert', FALSE),
       '#options' => $available_options,
-      '#description' => t('You can change the default for this field in "Comment follow-up notification settings" on <a href="!uri">your account edit page</a>.', array('!uri' => url('user/'. $user->uid .'/edit'))),
     );
 
   }
@@ -269,6 +267,11 @@ function comment_notify_comment($comment
       db_query($sql, $comment['notify'], $comment['cid']);
       break;
     case 'insert':
+      // If they subscribe and don't have a default let them know that it's possible to set one.
+      if (empty($user->comment_notify_mailalert) && $comment['notify']) {
+        drupal_set_message(t('You can change the default for this field in "Comment follow-up notification settings" on <a href="!uri">your account edit page</a>.', array('!uri' => url('user/'. $user->uid .'/edit'))));
+      }
+
        // For new comments, we first build up a string to be used as the identifier for the alert
       $mail = empty($comment['mail']) ? $user->mail : $comment['mail'];
       $notify_hash = drupal_get_token($mail . $comment['cid']);
@@ -357,7 +360,7 @@ function _comment_notify_mailalert($comm
 
   // 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) {
+  if (!empty($author->node_notify_mailalert) && $author->node_notify_mailalert == 1 && $user->mail != $author->mail) {
     $message = t(
       variable_get('node_notify_default_mailtext', AUTHOR_MAILTEXT),
       array(
@@ -381,7 +384,7 @@ function _comment_notify_mailalert($comm
     drupal_mail('node_notify_mail', $author->mail, $subject, $message, $from, array());
     $sent_to[] = $author->mail;
   }
- 
+
   //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
     FROM {comments} c INNER JOIN {comment_notify} cn on c.cid = cn.cid LEFT OUTER JOIN {users} u ON c.uid = u.uid
