Did away with lprintf all together now its called CtdlLogPrintf()
[citadel.git] / citadel / modules / listsub / serv_listsub.c
index 8b1db778896e7f6efd5dceb5c6d5025aba1e6e0d..82c6774dd70c971aee0ac115f40487d64219eb8a 100644 (file)
@@ -33,6 +33,7 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
@@ -43,7 +44,6 @@
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
-#include "tools.h"
 #include "internet_addressing.h"
 #include "clientsocket.h"
 #include "file_ops.h"
@@ -74,7 +74,7 @@ void listsub_generate_token(char *buf) {
        );
 
        /* Convert it to base64 so it looks cool */     
-       CtdlEncodeBase64(buf, sourcebuf, strlen(sourcebuf));
+       CtdlEncodeBase64(buf, sourcebuf, strlen(sourcebuf), 0);
 }
 
 
@@ -156,7 +156,7 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) {
 
        /* Generate and send the confirmation request */
 
-       urlesc(urlroom, qrbuf.QRname);
+       urlesc(urlroom, ROOMNAMELEN, qrbuf.QRname);
 
        snprintf(confirmation_request, sizeof confirmation_request,
 
@@ -296,7 +296,7 @@ void do_unsubscribe(char *room, char *email, char *webpage) {
 
        /* Generate and send the confirmation request */
 
-       urlesc(urlroom, qrbuf.QRname);
+       urlesc(urlroom, ROOMNAMELEN, qrbuf.QRname);
 
        snprintf(confirmation_request, sizeof confirmation_request,
 
@@ -506,7 +506,7 @@ void do_confirm(char *room, char *token) {
         */
        if (success) {
                cprintf("%d %d operation(s) confirmed.\n", CIT_OK, success);
-               lprintf(CTDL_NOTICE, 
+               CtdlLogPrintf(CTDL_NOTICE, 
                        "Mailing list: %s %ssubscribed to %s with token %s\n", 
                        email, 
                        (!IsEmptyStr(address_to_unsubscribe)) ? "un" : "", 
@@ -570,8 +570,11 @@ void cmd_subs(char *cmdbuf) {
  */
 CTDL_MODULE_INIT(listsub)
 {
-       CtdlRegisterProtoHook(cmd_subs, "SUBS", "List subscribe/unsubscribe");
-
+       if (!threading)
+       {
+               CtdlRegisterProtoHook(cmd_subs, "SUBS", "List subscribe/unsubscribe");
+       }
+       
        /* return our Subversion id for the Log */
        return "$Id$";
 }