Removed the logic that attempted to deliver mailing lists not more than once per...
authorArt Cancro <ajc@citadel.org>
Sun, 24 Apr 2016 23:16:09 +0000 (19:16 -0400)
committerArt Cancro <ajc@citadel.org>
Sun, 24 Apr 2016 23:16:09 +0000 (19:16 -0400)
citadel/modules/network/serv_netspool.c

index b13f1b8ff1f4827a91e50a7114476b72abf89962..ab0aa9f9963dd6032d632c6261607f89d953b343 100644 (file)
@@ -410,7 +410,6 @@ void CalcListID(SpoolControl *sc)
        FreeStrBuf(&RoomName);
 }
 
-static time_t last_digest_delivery = 0;
 
 /*
  * Batch up and send all outbound traffic from the current room
@@ -450,8 +449,7 @@ void network_spoolout_room(SpoolControl *sc)
        }
        else
        {
-               snprintf(buf, sizeof buf, "room_%s@%s",
-                        CCC->room.QRname, CtdlGetConfigStr("c_fqdn"));
+               snprintf(buf, sizeof buf, "room_%s@%s", CCC->room.QRname, CtdlGetConfigStr("c_fqdn"));
        }
 
        for (i=0; buf[i]; ++i) {
@@ -461,41 +459,18 @@ void network_spoolout_room(SpoolControl *sc)
 
 
        /* If we wrote a digest, deliver it and then close it */
-       if (sc->Users[digestrecp] != NULL) {
-               time_t now = time(NULL);
-               time_t secs_today = now % (24 * 60 * 60);
-               long delta = 0;
-
-               if (last_digest_delivery != 0) {
-                       delta = now - last_digest_delivery;
-                       delta = (24 * 60 * 60) - delta;
-               }
-
-               if ((secs_today < 300) && 
-                   (delta < 300))
-               {
-                       if (sc->digestfp == NULL) {
-                               sc->digestfp = create_digest_file(&sc->room, 0);
-                       }
-                       if (sc->digestfp != NULL) {
-                               last_digest_delivery = now;
-                               fprintf(sc->digestfp,
-                                       " -----------------------------------"
-                                       "------------------------------------"
-                                       "-------\n"
-                                       "You are subscribed to the '%s' "
-                                       "list.\n"
-                                       "To post to the list: %s\n",
-                                       CCC->room.QRname, buf
-                                       );
-                               network_deliver_digest(sc);     /* deliver */
-                               remove_digest_file(&sc->room);
-                       }
-               }
-       }
-       if (sc->digestfp != NULL) {
+       if ( (sc->Users[digestrecp] != NULL) && (sc->digestfp != NULL) )
+       {
+               fprintf(sc->digestfp,
+                       " ------------------------------------------------------------------------------\n"
+                       "You are subscribed to the '%s' list.\n"
+                       "To post to the list: %s\n",
+                       CCC->room.QRname, buf
+               );
+               network_deliver_digest(sc);     /* deliver */
                fclose(sc->digestfp);
                sc->digestfp = NULL;
+               remove_digest_file(&sc->room);
        }
 
        /* Now rewrite the netconfig */