Index: og2list.module =================================================================== RCS file: /cvs/drupal/contributions/modules/og2list/og2list.module,v retrieving revision 1.106 diff -u -r1.106 og2list.module --- og2list.module 7 May 2007 11:54:05 -0000 1.106 +++ og2list.module 15 Jun 2007 18:44:15 -0000 @@ -378,6 +378,17 @@ } break; case 'update': + /* If the node previously did not have an address and one has just been assigned, + * then we need to set it now. If the node did have an og2list_groups row before + * then the recipient wasn't set and we update it. For now you still cannot change + * a recipient once it's set. + */ + if ($node->recipient && + (db_num_rows(db_query("SELECT recipient FROM {og2list_groups} WHERE nid = %d",$node->nid)) == 0)) { + db_query("INSERT INTO {og2list_groups} (nid, recipient, status) " + . " VALUES(%d, '%s', 1)", $node->nid, $node->recipient); + } + if ($node->status == 1) { db_query('UPDATE {og2list_outgoing_arguments} a INNER JOIN {og2list_outgoing_content} c ON a.mid = c.mid SET a.status = %d WHERE c.is_node = 1 AND c.id = %d AND a.status = %d', OG2LIST_OUTGOING_NOT_SENT, $node->nid, OG2LIST_OUTGOING_MODERATED); }