Index: modules/signup/rsvp_signup.module
===================================================================
--- modules/signup/rsvp_signup.module	(revision 134)
+++ modules/signup/rsvp_signup.module	(working copy)
@@ -10,32 +10,21 @@
  *
  */
 
-
-
-
 /**
- * Implementation of hook_form_alter().
+ * Implementation of hook_form_FORM_ID_alter().
  * 
- * weigth of plugins is always 40
- * 
- * to append the additional signup submit method to the reply form.
+ * Append the additional signup submit method to the reply form.
  *
  * @ingroup rsvp_signup
- * 
  */
-function rsvp_signup_form_alter(&$form, $form_state, $form_id) {
-  
-  if ($form_id == 'rsvp_reply_form') {
-
-  	
-  	$form['submit']['#submit'][] = 'rsvp_signup_form_submit';
-  }
-  
+function rsvp_signup_form_rsvp_reply_form_alter(&$form, $form_state) {
+  $form['submit']['#submit'][] = 'rsvp_signup_rsvp_reply_form_submit';
 }
 
-
-function rsvp_signup_form_submit($form, &$form_state) {
-
+/**
+ * Submit handler for the rsvp reply form
+ */
+function rsvp_signup_rsvp_reply_form_submit($form, &$form_state) {
   $reply = $form_state['values']['reply_invite_reply'];
   $rsvp = $form_state['values']['rsvp'];
   $invite_target = $form_state['values']['invite_target'];
@@ -54,8 +43,7 @@
       return;
     }
     
-  	if ( $invite_target->uid > 0 ) {
-
+  	if ($invite_target->uid > 0) {
       // Sign up the registered user.
       $signups = signup_list_user_signups($invite_target->uid);
       if (!in_array($rsvp->nid, array_keys($signups))) {
@@ -79,8 +67,33 @@
       }
     }
   }
+}
 
+/**
+ * Implementation of hook_form_FORM_ID_alter()
+ * 
+ * Append a submit handler for the signup form
+ */
+function rsvp_signup_form_signup_form_alter(&$form, &$form_state) {
+  $form['#submit'][] = 'rsvp_signup_signup_form_submit';
 }
 
-
-
+/**
+ * Submit handler for the signup form
+ */
+function rsvp_signup_signup_form_submit(&$form, &$form_state) {
+  module_load_include('inc', 'rsvp', 'rsvp.functions');
+  
+  // Extract values
+  $nid = $form_state['values']['nid'];
+  $uid = $form_state['values']['uid'];
+  
+  // Update any pending invitations for this user for this group
+  // to reply "yes"
+  // There are no direct API functions to do this, so a query
+  // must be used here
+  if ($uid) {
+    $sql = "UPDATE {rsvp_invite} ri INNER JOIN {rsvp} r ON ri.rid = r.rid SET ri.response = '%s' WHERE ri.uid = %d AND r.nid = %d";
+    db_query($sql, RSVP_ATT_YES, $uid, $nid);
+  }
+}
