-
- /*
- * Figure out how big a buffer we need to alloc
- */
- for (nptr = sc->RNCfg->NetConfigs[participate];
- nptr != NULL;
- nptr = nptr->next)
- {
- if (msg->cm_fields['R'] != NULL) {
- free(msg->cm_fields['R']);
- }
- msg->cm_fields['R'] =
- strdup(ChrPtr(nptr->Value[0]));
-
- valid = validate_recipients(msg->cm_fields['R'],
- NULL, 0);
-
- CtdlSubmitMsg(msg, valid, "", 0);
- free_recipients(valid);
- }
+
+ aggregate_recipients(&recps, participate, sc->RNCfg);
+ precps = SmashStrBuf(&recps);
+ valid = validate_recipients(precps, NULL, 0);
+
+ if (msg->cm_fields['R'] != NULL) {
+ free(msg->cm_fields['R']);
+ }/* TODO: check whether 'R' is set appropriate later. */
+
+ CtdlSubmitMsg(msg, valid, "", 0);
+ free_recipients(valid);