? 799688_comment_notify_settings_not_saving.patch
? 821600_general_cleanup.patch
? 822924-cn-token-tree-2-D7.patch
? 822924-cn-token-tree-D7.patch
? 913018-1-object-reference.patch
? cn_install_cid_field.patch
Index: comment_notify.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_notify/comment_notify.module,v
retrieving revision 1.88
diff -u -p -r1.88 comment_notify.module
--- comment_notify.module	11 Oct 2010 01:31:35 -0000	1.88
+++ comment_notify.module	11 Oct 2010 01:47:49 -0000
@@ -78,7 +78,7 @@ function _comment_notify_options() {
 
 
 function comment_notify_form_comment_form_alter(&$form, &$form_state, $form_id) {
-  
+
   global $user;
   if (!(user_access('subscribe to comments') || user_access('administer comments'))) {
     return;
@@ -241,7 +241,7 @@ function comment_notify_comment_publish(
  */
 function comment_notify_comment_update($comment) {
   module_load_include('inc', 'comment_notify', 'comment_notify');
-  
+
   // In case they have changed their status, save it in the database.
   if (isset($comment->notify_type)) {
     comment_notify_update_notification($comment->cid, $comment->notify_type);
@@ -255,7 +255,7 @@ function comment_notify_comment_update($
 
 function comment_notify_comment_insert($comment) {
   module_load_include('inc', 'comment_notify', 'comment_notify');
-  
+
   global $user;
   // For new comments, we first build up a string to be used as the identifier for the alert.
   // This identifier is used to later unsubscribe the user or allow them to
@@ -295,7 +295,7 @@ function comment_notify_comment_delete($
  */
 function comment_notify_form_alter(&$form, &$form_state, $form_id) {
   module_load_include('inc', 'comment_notify', 'comment_notify');
-    
+
   if (!($form_id == 'user_register_form' || $form_id == 'user_profile_form')) {
     return;
   }
@@ -359,7 +359,7 @@ function comment_notify_user_update(&$ed
   }
   if (isset($edit['node_notify']) && isset($edit['comment_notify'])) {
     module_load_include('inc', 'comment_notify', 'comment_notify');
-    
+
     // Save the values of node_notify_mailalert and comment_notify_mailalert
     // to {comment_notify_user_settings}.
     comment_notify_set_user_notification_setting($account->uid, $edit['node_notify'], $edit['comment_notify']);
@@ -372,7 +372,7 @@ function comment_notify_user_update(&$ed
 
 function comment_notify_user_load($users) {
   module_load_include('inc', 'comment_notify', 'comment_notify');
-  
+
   // @todo: Why would we want to load this on every user load?
   foreach ($users as &$user) {
     $user->comment_notify_settings = comment_notify_get_user_notification_setting($user->uid);
@@ -394,11 +394,12 @@ function comment_notify_user_cancel(&$ed
  */
 function _comment_notify_mailalert($comment) {
   module_load_include('inc', 'comment_notify', 'comment_notify');
-  
+
   $comment = (object) $comment;
   global $language;
   global $base_url;
   global $user;
+  $initial_language = $language;
 
   $nid = $comment->nid;
   $cid = $comment->cid;
@@ -410,13 +411,6 @@ function _comment_notify_mailalert($comm
     return;
   }
 
-  $initial_language = $language;
-
-  if (function_exists('locale')) {
-    $languages = locale_language_list();
-    $languages = $languages['name'];
-  }
-
   $node = node_load($nid);
 
   // No mails if this is not an enabled content type.
@@ -493,10 +487,6 @@ function _comment_notify_mailalert($comm
         $message[$k] = token_replace(t($v), array('comment' => $comment, 'node' => $node, 'user' => $user));
       }
 
-      //      array(
-      //          '!link1' => url('comment_notify/disable/'. $alert->notify_hash, array('absolute' => TRUE))
-      //      )
-
       drupal_mail('comment_notify', 'comment_notify_mail', $mail, $language, $message);
       $sent_to[] = $mail;
 
@@ -512,14 +502,14 @@ function _comment_notify_mailalert($comm
       watchdog(
         'comment_notify',
         'Notified: !user_mail',
-      array('!user_mail' => $user_mail),
-      WATCHDOG_NOTICE,
-      l(t('source comment'), 'node/' . $nid, array(
-          'fragment' => 'comment-' . $alert->cid,
-      ))
+        array('!user_mail' => $user_mail),
+          WATCHDOG_NOTICE,
+          l(t('source comment'), 'node/' . $nid, array(
+            'fragment' => 'comment-' . $alert->cid,
+          ))
       );
 
-      // revert to previous (site default) locale
+      // Revert to previous (site default) locale.
       $language = $initial_language;
     }
   }
@@ -575,7 +565,7 @@ function comment_notify_unsubscribe_subm
  */
 function comment_notify_settings() {
   module_load_include('inc', 'comment_notify', 'comment_notify');
-  
+
   $form['comment_notify_settings'] = array();
 
   // Only perform comment_notify for certain node types.
