+void aggregate_recipients(StrBuf **recps, RoomNetCfg Which, OneRoomNetCfg *OneRNCfg)
+{
+ size_t recps_len = 0;
+ RoomNetCfgLine *nptr;
+ struct CitContext *CCC = CC;
+
+ /*
+ * Figure out how big a buffer we need to allocate
+ */
+ for (nptr = OneRNCfg->NetConfigs[Which]; nptr != NULL; nptr = nptr->next) {
+ recps_len = recps_len + StrLength(nptr->Value[0]) + 2;
+ }
+
+ *recps = NewStrBufPlain(NULL, recps_len);
+
+ if (*recps == NULL) {
+ QN_syslog(LOG_EMERG,
+ "Cannot allocate %ld bytes for recps...\n",
+ (long)recps_len);
+ abort();
+ }
+
+ /* Each recipient */
+ for (nptr = OneRNCfg->NetConfigs[Which]; nptr != NULL; nptr = nptr->next) {
+ if (nptr != OneRNCfg->NetConfigs[Which]) {
+ StrBufAppendBufPlain(*recps, HKEY(","), 0);
+ }
+ StrBufAppendBuf(*recps, nptr->Value[0], 0);
+ }
+}
+