Citadel Networking: add configured remote room name, so its later on put into the...
[citadel.git] / citadel / modules / network / serv_netmail.c
index dac000efc8527477b2cc6b0185f1ccd2c75f70b3..b84c5dea2c941224fb7e31557495047521a54b6f 100644 (file)
@@ -117,6 +117,12 @@ void aggregate_recipients(StrBuf **recps, RoomNetCfg Which, OneRoomNetCfg *OneRN
                                StrBufAppendBufPlain(*recps, HKEY(","), i);
                }
                StrBufAppendBuf(*recps, nptr->Value[0], 0);
+               if (Which == ignet_push_share)
+               {
+                       StrBufAppendBufPlain(*recps, HKEY(","), 0);
+                       StrBufAppendBuf(*recps, nptr->Value[1], 0);
+
+               }
        }
 }
 
@@ -320,26 +326,8 @@ void network_process_list(SpoolControl *sc, struct CtdlMessage *omsg, long *dele
 
        msg = CtdlDuplicateMessage(omsg);
 
-       if (msg->cm_fields['K'] != NULL)
-               free(msg->cm_fields['K']);
-       if (msg->cm_fields['V'] == NULL){
-               /* local message, no enVelope */
-               StrBuf *Buf;
-               Buf = NewStrBuf();
-               StrBufAppendBufPlain(Buf,
-                                    msg->cm_fields['O']
-                                    , -1, 0);
-               StrBufAppendBufPlain(Buf, HKEY("@"), 0);
-               StrBufAppendBufPlain(Buf, config.c_fqdn, -1, 0);
-
-               msg->cm_fields['K'] = SmashStrBuf(&Buf);
-       }
-       else {
-               msg->cm_fields['K'] =
-                       strdup (msg->cm_fields['V']);
-       }
 
-       CtdlMsgSetCM_Fields(msg, 'F', SKEY(sc->Users[roommailalias]));
+       CtdlMsgSetCM_Fields(msg, 'K', SKEY(sc->Users[roommailalias]));
 
        /* if there is no other recipient, Set the recipient
         * of the list message to the email address of the
@@ -544,7 +532,7 @@ void network_process_ignetpush(SpoolControl *sc, struct CtdlMessage *omsg, long
                        }
                        
                        QN_syslog(LOG_INFO,
-                                 "%sSending to %s\n",
+                                 " %sSending to %s\n",
                                  (send)?"":"Not ",
                                  ChrPtr(Recipient));
                }
@@ -618,6 +606,7 @@ void network_process_ignetpush(SpoolControl *sc, struct CtdlMessage *omsg, long
 void network_spool_msg(long msgnum,
                       void *userdata)
 {
+       struct CitContext *CCC = CC;
        struct CtdlMessage *msg = NULL;
        long delete_after_send = 0;     /* Set to 1 to delete after spooling */
        SpoolControl *sc;
@@ -626,6 +615,13 @@ void network_spool_msg(long msgnum,
 
        msg = CtdlFetchMessage(msgnum, 1);
 
+       if (msg == NULL)
+       {
+               QN_syslog(LOG_ERR,
+                         "failed to load Message <%ld> from disk\n",
+                         msgnum);
+               return;
+       }
        network_process_list(sc, msg, &delete_after_send);
        network_process_digest(sc, msg, &delete_after_send);
        network_process_participate(sc, msg, &delete_after_send);