* CtdlMakeMessage() accept NULLs for certain fields; use them when submitting calenda...
authorArt Cancro <ajc@citadel.org>
Mon, 15 Jun 2009 20:58:54 +0000 (20:58 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 15 Jun 2009 20:58:54 +0000 (20:58 +0000)
citadel/modules/calendar/serv_calendar.c
citadel/msgbase.c

index 094ab130809a73167e56a0990a5e4414d8926706..61965b5360addf0b3bd62b72f1499506eaa753d4 100644 (file)
@@ -2171,16 +2171,20 @@ void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal)
                        serialized_request
                );
 
-               msg = CtdlMakeMessage(&CC->user,
-                       "",                     /* No single recipient here */
-                       "",                     /* No single recipient here */
-                       CC->room.QRname, 0, FMT_RFC822,
-                       "",
-                       "",
+               msg = CtdlMakeMessage(
+                       &CC->user,
+                       NULL,                   /* No single recipient here */
+                       NULL,                   /* No single recipient here */
+                       CC->room.QRname,
+                       0,
+                       FMT_RFC822,
+                       NULL,
+                       NULL,
                        summary_string,         /* Use summary for subject */
                        NULL,
                        request_message_text,
-                       NULL);
+                       NULL
+               );
        
                if (msg != NULL) {
                        valid = validate_recipients(attendees_string, NULL, 0);
index 0edc142d9f29cbae0d81afb031050b1ce8325615..b4eed046f9dc08a99bcfe14cd5ad48a660ab7c52 100644 (file)
@@ -3227,8 +3227,8 @@ struct CtdlMessage *CtdlMakeMessage(
        /* Don't confuse the poor folks if it's not routed mail. */
        strcpy(dest_node, "");
 
-       striplt(recipient);
-       striplt(recp_cc);
+       if (recipient != NULL) striplt(recipient);
+       if (recp_cc != NULL) striplt(recp_cc);
 
        /* Path or Return-Path */
        if (my_email == NULL) my_email = "";
@@ -3245,10 +3245,12 @@ struct CtdlMessage *CtdlMakeMessage(
        snprintf(buf, sizeof buf, "%ld", (long)time(NULL));     /* timestamp */
        msg->cm_fields['T'] = strdup(buf);
 
-       if (fake_name[0])                                       /* author */
+       if ((fake_name != NULL) && (fake_name[0])) {            /* author */
                msg->cm_fields['A'] = strdup(fake_name);
-       else
+       }
+       else {
                msg->cm_fields['A'] = strdup(author->fullname);
+       }
 
        if (CC->room.QRflags & QR_MAILBOX) {            /* room */
                msg->cm_fields['O'] = strdup(&CC->room.QRname[11]);
@@ -3260,10 +3262,10 @@ struct CtdlMessage *CtdlMakeMessage(
        msg->cm_fields['N'] = strdup(NODENAME);         /* nodename */
        msg->cm_fields['H'] = strdup(HUMANNODE);                /* hnodename */
 
-       if (recipient[0] != 0) {
+       if ((recipient != NULL) && (recipient[0] != 0)) {
                msg->cm_fields['R'] = strdup(recipient);
        }
-       if (recp_cc[0] != 0) {
+       if ((recp_cc != NULL) && (recp_cc[0] != 0)) {
                msg->cm_fields['Y'] = strdup(recp_cc);
        }
        if (dest_node[0] != 0) {