Fix warnings all over citserver; handle function replies; remove unused code.
[citadel.git] / citadel / modules / network / serv_network.c
index 9115b1fb4ee611620824b2c5d7031ac1a7c479da..7955f5a2eb935ebe4b16336c2f0d51a9653a9a36 100644 (file)
@@ -494,7 +494,6 @@ void network_deliver_digest(SpoolControl *sc) {
        long msglen;
        char *recps = NULL;
        size_t recps_len = SIZ;
-       size_t siz;
        struct recptypes *valid;
        namelist *nptr;
        char bounce_to[256];
@@ -541,7 +540,7 @@ void network_deliver_digest(SpoolControl *sc) {
 
        msg->cm_fields['M'] = malloc(msglen + 1);
        fseek(sc->digestfp, 0L, SEEK_SET);
-       siz = fread(msg->cm_fields['M'], (size_t)msglen, 1, sc->digestfp);
+       fread(msg->cm_fields['M'], (size_t)msglen, 1, sc->digestfp);
        msg->cm_fields['M'][msglen] = '\0';
 
        fclose(sc->digestfp);
@@ -653,7 +652,6 @@ void network_spool_msg(long msgnum, void *userdata) {
        SpoolControl *sc;
        int i;
        char *newpath = NULL;
-       size_t instr_len = SIZ;
        struct CtdlMessage *msg = NULL;
        namelist *nptr;
        maplist *mptr;
@@ -672,7 +670,6 @@ void network_spool_msg(long msgnum, void *userdata) {
        /*
         * Process mailing list recipients
         */
-       instr_len = SIZ;
        if (sc->listrecps != NULL) {
                /* Fetch the message.  We're going to need to modify it
                 * in order to insert the [list name] in it, etc.
@@ -743,16 +740,20 @@ void network_spool_msg(long msgnum, void *userdata) {
 
                        /* else we won't modify the buffer, since the roomname is already here. */
 
-                       /* if we don't already have a 'reply to' field, put our roomname in. */
-                       if (msg->cm_fields['K'] == NULL) {
-                               msg->cm_fields['K'] = malloc(256);
-                               snprintf(msg->cm_fields['K'], 256,
-                                        "room_%s@%s", CC->room.QRname,
-                                        config.c_fqdn);
-                               for (i=0; msg->cm_fields['K'][i]; ++i) {
-                                       if (isspace(msg->cm_fields['K'][i])) {
-                                               msg->cm_fields['K'][i] = '_';
-                                       }
+                       /* Set the recipient of the list message to the
+                        * email address of the room itself.
+                        * FIXME ... I want to be able to pick any address
+                        */
+                       if (msg->cm_fields['R'] != NULL) {
+                               free(msg->cm_fields['R']);
+                       }
+                       msg->cm_fields['R'] = malloc(256);
+                       snprintf(msg->cm_fields['R'], 256,
+                               "room_%s@%s", CC->room.QRname,
+                               config.c_fqdn);
+                       for (i=0; msg->cm_fields['R'][i]; ++i) {
+                               if (isspace(msg->cm_fields['R'][i])) {
+                                       msg->cm_fields['R'][i] = '_';
                                }
                        }
 
@@ -806,7 +807,6 @@ void network_spool_msg(long msgnum, void *userdata) {
        /*
         * Process client-side list participations for this room
         */
-       instr_len = SIZ;
        if (sc->participates != NULL) {
                msg = CtdlFetchMessage(msgnum, 1);
                if (msg != NULL) {