It causes the attachments window to be saved as part of the message text.
Oof.
char *mailbcc = get_url_param(h, "mailbcc"); // Bcc:
if (!mailbcc) mailbcc = "";
+ // If there are attachments, we have to merge them into the message text.
+ char *att = get_url_param(h, "att");
+ if (!att) {
+ syslog(LOG_DEBUG, "attachments: <%s>", att); // FIXME write this
+ }
+
// Mode 4 will give us metadata back after upload
ctdl_printf(c, "ENT0 1|%s||4|%s||1|%s|%s|||%s|", mailto, subj, mailcc, mailbcc, wefw);
ctdl_readline(c, buf, sizeof buf);
+ ` `
+ item["uploadfilename"] + " (" + item["contenttype"] + ", " + item["contentlength"] + " " + _("bytes") + ")";
document.getElementById("ctdl-upload_list").appendChild(new_upl);
- });
- // append it to the global list of uploads
- uploads.push(j_response);
+ // append it to the global list of uploads
+ uploads.push(item);
+ });
document.getElementById("num_attachments").innerHTML = uploads.length;
}
else if (xhr.readyState == 4 && xhr.status != 200) {
document.getElementById("ctdl-compose-cc-field").style.display = "block";
}
- activate_uploads("ctdl-editor-body");
+ activate_uploads("ctdl-compose-mail");
}
// Called when the user clicks the button to make the hidden "CC" and "BCC" lines appear.
+ "&mailcc=" + msm_field("ctdl-compose-cc-field", ",") // Cc: (if present)
+ "&mailbcc=" + msm_field("ctdl-compose-bcc-field", ",") // Bcc: (if present)
;
+ if (uploads.length > 0) {
+ url += "&att=";
+ for (let i=0; i<uploads.length; ++i) {
+ url += uploads[i]["ref"];
+ if (i != uploads.length - 1) {
+ url += ",";
+ }
+ }
+ }
boundary = randomString();
body_text =
"--" + boundary + "\r\n"
}
}
+ // successfully saving a message means the attachments are now gone from the server.
+ uploads = [];
+
// After saving the message, go back to the mailbox view.
gotoroom(current_room);