Removed the caching of netconfig entries. The caching of configdb entries now serves...
[citadel.git] / citadel / modules / listsub / serv_listsub.c
index 889926ac48d250bd5717d7645c5d2500dfd4eaab..ae8554bafb0ce9f065b60fcc220949126a2e0211 100644 (file)
 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};
@@ -589,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";
                }
        }
@@ -633,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);