- SpoolControl *sc;
- namelist *nptr = NULL;
- maplist *mptr = NULL;
-
- sc = *scc;
- while (sc->listrecps != NULL) {
- nptr = sc->listrecps->next;
- free(sc->listrecps);
- sc->listrecps = nptr;
- }
- /* Do the same for digestrecps */
- while (sc->digestrecps != NULL) {
- nptr = sc->digestrecps->next;
- free(sc->digestrecps);
- sc->digestrecps = nptr;
- }
- /* Do the same for participates */
- while (sc->participates != NULL) {
- nptr = sc->participates->next;
- free(sc->participates);
- sc->participates = nptr;
- }
- while (sc->ignet_push_shares != NULL) {
- mptr = sc->ignet_push_shares->next;
- free(sc->ignet_push_shares);
- sc->ignet_push_shares = mptr;
- }
- free(sc->misc);
- free(sc);
- *scc=NULL;
+ RoomNetCfgLine *nptr;
+ nptr = (RoomNetCfgLine *)
+ malloc(sizeof(RoomNetCfgLine));
+ memset(nptr, 0, sizeof(RoomNetCfgLine));
+ OneRNCFG->lastsent = extract_long(LinePos, 0);
+ OneRNCFG->NetConfigs[ThisOne->C] = nptr;
+}
+
+void ParseRoomAlias(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *rncfg)
+{
+ if (rncfg->Sender != NULL)
+ return;
+
+ ParseGeneric(ThisOne, Line, LinePos, rncfg);
+ rncfg->Sender = NewStrBufDup(rncfg->NetConfigs[roommailalias]->Value[0]);
+}
+
+void ParseSubPendingLine(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *OneRNCFG)
+{
+ if (time(NULL) - extract_long(LinePos, 3) > EXP)
+ return; /* expired subscription... */
+
+ ParseGeneric(ThisOne, Line, LinePos, OneRNCFG);
+}
+void ParseUnSubPendingLine(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *OneRNCFG)
+{
+ if (time(NULL) - extract_long(LinePos, 2) > EXP)
+ return; /* expired subscription... */
+
+ ParseGeneric(ThisOne, Line, LinePos, OneRNCFG);
+}
+
+
+void SerializeLastSent(const CfgLineType *ThisOne, StrBuf *OutputBuffer, OneRoomNetCfg *RNCfg, RoomNetCfgLine *data)
+{
+ StrBufAppendBufPlain(OutputBuffer, CKEY(ThisOne->Str), 0);
+ StrBufAppendPrintf(OutputBuffer, "|%ld\n", RNCfg->lastsent);
+}
+
+void DeleteLastSent(const CfgLineType *ThisOne, RoomNetCfgLine **data)
+{
+ free(*data);
+ *data = NULL;
+}
+
+static const RoomNetCfg SpoolCfgs [4] = {
+ listrecp,
+ digestrecp,
+ participate,
+ ignet_push_share
+};
+
+static const long SpoolCfgsCopyN [4] = {
+ 1, 1, 1, 2
+};
+
+int HaveSpoolConfig(OneRoomNetCfg* RNCfg)
+{
+ int i;
+ int interested = 0;
+ for (i=0; i < 4; i++) if (RNCfg->NetConfigs[SpoolCfgs[i]] == NULL) interested = 1;
+ return interested;
+}
+
+void Netmap_AddMe(struct CtdlMessage *msg, const char *defl, long defllen)
+{
+ long node_len;
+ char buf[SIZ];
+
+ /* prepend our node to the path */
+ if (CM_IsEmpty(msg, eMessagePath)) {
+ CM_SetField(msg, eMessagePath, defl, defllen);
+ }
+ node_len = strlen(CtdlGetConfigStr("c_nodename"));
+ if (node_len >= SIZ)
+ node_len = SIZ - 1;
+ memcpy(buf, CtdlGetConfigStr("c_nodename"), node_len);
+ buf[node_len] = '!';
+ buf[node_len + 1] = '\0';
+ CM_PrependToField(msg, eMessagePath, buf, node_len + 1);