]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/network/serv_netspool.c
fix dnamlen, they missed the e, so we need to follow.
[citadel.git] / citadel / modules / network / serv_netspool.c
index 9928c7e4b9f252eec4c9f9831dec5ab3bce9079f..8a8a1e401c439a2454b0a7fc319431c0f6179b01 100644 (file)
@@ -224,6 +224,7 @@ void InspectQueuedRoom(SpoolControl **pSC,
 
 void CalcListID(SpoolControl *sc)
 {
+       StrBuf *RoomName;
        const char *err;
        int fd;
        struct CitContext *CCC = CC;
@@ -264,6 +265,9 @@ void CalcListID(SpoolControl *sc)
        }
 
        StrBufAppendBufPlain(sc->ListID, HKEY("<"), 0);
+       RoomName = NewStrBufPlain (sc->room.QRname, -1);
+       StrBufAsciify(RoomName, '_');
+       StrBufReplaceChars(RoomName, ' ', '_');
 
        if (StrLength(sc->Users[roommailalias]) > 0)
        {
@@ -282,7 +286,7 @@ void CalcListID(SpoolControl *sc)
        else
        {
                StrBufAppendBufPlain(sc->ListID, HKEY("room_"), 0);
-               StrBufAppendBufPlain(sc->ListID, sc->room.QRname, -1, 0);
+               StrBufAppendBuf(sc->ListID, RoomName, 0);
                StrBufAppendBufPlain(sc->ListID, HKEY("."), 0);
                StrBufAppendBufPlain(sc->ListID, config.c_fqdn, -1, 0);
                /*
@@ -299,15 +303,15 @@ void CalcListID(SpoolControl *sc)
        {
                sc->Users[roommailalias] = NewStrBuf();
                
-               StrBufPrintf(sc->Users[roommailalias],
-                            "room_%s@%s",
-                            CCC->room.QRname,
-                            config.c_fqdn);
+               StrBufAppendBufPlain(sc->Users[roommailalias], HKEY("room_"), 0);
+               StrBufAppendBuf(sc->Users[roommailalias], RoomName, 0);
+               StrBufAppendBufPlain(sc->Users[roommailalias], HKEY("@"), 0);
+               StrBufAppendBufPlain(sc->Users[roommailalias], config.c_fqdn, -1, 0);
 
-               StrBufAsciify(sc->Users[roommailalias], '_');
                StrBufLowerCase(sc->Users[roommailalias]);
        }
 
+       FreeStrBuf(&RoomName);
 }
 
 
@@ -624,7 +628,7 @@ void network_process_file(char *filename,
        long msgend = (-1L);
        long msgcur = 0L;
        int ch;
-
+       int nMessages = 0;
 
        fp = fopen(filename, "rb");
        if (fp == NULL) {
@@ -653,6 +657,7 @@ void network_process_file(char *filename,
                }
 
                ++msgcur;
+               nMessages ++;
        }
 
        msgend = msgcur - 1;
@@ -663,8 +668,15 @@ void network_process_file(char *filename,
                                        working_ignetcfg,
                                        the_netmap,
                                        netmap_changed);
+               nMessages ++;
        }
 
+       if (nMessages > 0)
+               QN_syslog(LOG_INFO,
+                         "network: processed %d messages in %s\n",
+                         nMessages,
+                         filename);
+
        fclose(fp);
        unlink(filename);
 }
@@ -713,7 +725,7 @@ void network_do_spoolin(HashList *working_ignetcfg, HashList *the_netmap, int *n
               (filedir_entry != NULL))
        {
 #ifdef _DIRENT_HAVE_D_NAMLEN
-               d_namelen = filedir_entry->d_namelen;
+               d_namelen = filedir_entry->d_namlen;
 
 #else
                d_namelen = strlen(filedir_entry->d_name);
@@ -817,7 +829,7 @@ void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
               (filedir_entry != NULL))
        {
 #ifdef _DIRENT_HAVE_D_NAMLEN
-               d_namelen = filedir_entry->d_namelen;
+               d_namelen = filedir_entry->d_namlen;
 
 #else
                d_namelen = strlen(filedir_entry->d_name);