Removed the caching of netconfig entries. The caching of configdb entries now serves...
[citadel.git] / citadel / modules / listsub / serv_listsub.c
index a9fd95bfb8761a8706c2fc1af3f644fa55e5f761..ae8554bafb0ce9f065b60fcc220949126a2e0211 100644 (file)
@@ -48,7 +48,6 @@
 #include "msgbase.h"
 #include "internet_addressing.h"
 #include "clientsocket.h"
-#include "file_ops.h"
 #include "ctdl_module.h"
 
 /*
 void listsub_generate_token(char *buf) {
        char sourcebuf[SIZ];
        static int seq = 0;
+       size_t len;
 
        /* Theo, please sit down and shut up.  This key doesn't have to be
         * tinfoil-hat secure, it just needs to be reasonably unguessable
         * and unique.
         */
-       sprintf(sourcebuf, "%lx",
+       len = sprintf(sourcebuf, "%lx",
                (long) (++seq + getpid() + time(NULL))
        );
 
        /* Convert it to base64 so it looks cool */     
-       CtdlEncodeBase64(buf, sourcebuf, strlen(sourcebuf), 0);
+       len = CtdlEncodeBase64(buf, sourcebuf, len, 0);
+       if (buf[len - 1] == '\n') {
+               buf[len - 1] = '\0';
+       }
 }
 
 const RoomNetCfg ActiveSubscribers[] = {listrecp, digestrecp};
@@ -590,7 +593,7 @@ void do_confirm(StrBuf **room, StrBuf **token) {
                {
                        /* whipe duplicate subscribe entry... */
                        OneRNCfg->changed = 1;
-                       SaveChangedConfigs();
+                       // SaveChangedConfigs(); FIXME FOOFOO SAVE CONFIG HERE
                        errmsg = "already subscribed";
                }
        }
@@ -634,7 +637,7 @@ void do_confirm(StrBuf **room, StrBuf **token) {
                }
                DeleteGenericCfgLine(NULL/*TODO*/, &ConfirmLine);
                OneRNCfg->changed = 1;
-               SaveChangedConfigs();
+               // SaveChangedConfigs(); FIXME FOOFOO SAVE CONFIG HERE
        }
 
        end_critical_section(S_NETCONFIGS);