diff -urp --strip-trailing-cr ../simplenews_register/simplenews_register.module ./simplenews_register.module
--- ../simplenews_register/simplenews_register.module	2009-06-22 13:03:05.000000000 +0200
+++ ./simplenews_register.module	2009-10-21 23:44:15.000000000 +0200
@@ -45,7 +45,14 @@ function simplenews_register_form_alter(
       '#default_value' => variable_get('simplenews_register_weight', 5),
       '#description' => t('Useful if you have profile fields or other elements in the user registration form.<br /> Heavier items will appear below lighter ones in the account registration form.')
     );
-    
+
+    $form['simplenews_register_options']['simplenews_register_login_activate'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Re-use user account confirmation for new subscriptions'),
+      '#default_value' => variable_get('simplenews_register_login_activate', FALSE),
+      '#description' => t("Defers the activation of subscriptions to the first successful login of the newly registered user. Since the user account confirmation (if any) serves as a sign-up confirmation too, there's no need to choose extra confirmation emails below in this case. Note that users already signed up as anonymous are not affected by this option, as their subscription is already confirmed.")
+    );
+
     foreach (taxonomy_get_tree(_simplenews_get_vid()) as $term) {
       $form['simplenews_register_options']['simplenews_register_'. $term->tid .'_newsletter'] = array(
         '#value' => check_plain($term->name),
@@ -101,6 +108,7 @@ function theme_simplenews_register_admin
   $header = array(t('Newsletter'), t('Show'), t('Show description'), t('Opt-out'), t('Email confirmation'));
   
   $output  = drupal_render($form['simplenews_register_weight']);
+  $output .= drupal_render($form['simplenews_register_login_activate']);
   $output .= theme('table', $header, $rows);
   return $output;
 }
@@ -173,18 +181,42 @@ function simplenews_register_user($op, &
       
     case 'insert':
     case 'update':
+      // Check whether this user was already subscribed to any newsletter.
+      // Note that we require a real subscription to a newsletter here, because
+      // a valid subscription object alone is no guarantee of already confirmed
+      // email address.
+      $subscription = simplenews_get_subscription((object) array('mail' => $edit['mail']));
+      $no_old_subscription = empty($subscription->tids);
+
       $display_message = FALSE;
+      $newly_subscribed = FALSE;
       foreach (taxonomy_get_tree(_simplenews_get_vid()) as $term) {
         if (!empty($edit['simplenews-'. $term->tid])) {
           if (variable_get('simplenews_register_'. $term->tid .'_show', TRUE)) {
             $display_message = TRUE;
           }
+          if ($no_old_subscription) {
+            $newly_subscribed = TRUE;
+          }
           simplenews_subscribe_user($edit['mail'], $term->tid, variable_get('simplenews_register_'. $term->tid .'_confirm', FALSE));
         }
       }
       if ($display_message) {
         drupal_set_message(t('Signing up for newsletter(s).'));
       }
+
+      if ($newly_subscribed && variable_get('simplenews_register_login_activate', FALSE)) {
+        // Make the new subscription inactive until first login.
+        db_query("UPDATE {simplenews_subscriptions} SET activated = 0 WHERE mail = '%s'", strtolower($edit['mail']));
+      }
+      break;
+
+    case 'login':
+      if ($account->access == 0 && variable_get('simplenews_register_login_activate', FALSE)) {
+        // This is first time a new user logs in. Make a subscription
+        // for this account active, if any.
+        db_query("UPDATE {simplenews_subscriptions} SET activated = %d WHERE uid = %d", $account->status, $account->uid);
+      }
       break;
   }
 }
