diff src/pst2dii.cpp.in @ 167:40e9de445038

improve consistency checking when fetching items from the pst file. avoid putting mixed item types into the same output folder.
author Carl Byington <carl@five-ten-sg.com>
date Wed, 18 Mar 2009 22:31:18 -0700
parents 6cb85306e28a
children 0e1e048716e4
line wrap: on
line diff
--- a/src/pst2dii.cpp.in	Tue Mar 17 12:14:43 2009 -0700
+++ b/src/pst2dii.cpp.in	Wed Mar 18 22:31:18 2009 -0700
@@ -204,8 +204,8 @@
     if (!(fp = fopen(temp, "wb"))) {
         WARN(("write_separate_attachment: Cannot open attachment save file \"%s\"\n", temp));
     } else {
-        if (current_attach->data)
-            pst_fwrite(current_attach->data, 1, current_attach->size, fp);
+        if (current_attach->data.data)
+            pst_fwrite(current_attach->data.data, 1, current_attach->data.size, fp);
         else {
             (void)pst_attach_to_file(pst, current_attach, fp);
         }
@@ -559,7 +559,7 @@
     } else if (item->email->htmlbody.str) {
         removeCR(item->email->htmlbody.str);
         print_pdf(item->email->htmlbody.str);
-    } else if (item->email->encrypted_body || item->email->encrypted_htmlbody) {
+    } else if (item->email->encrypted_body.data || item->email->encrypted_htmlbody.data) {
         char ln[LINE_SIZE];
         snprintf(ln, sizeof(ln), "%s", "The body of this email is encrypted. This isn't supported yet, but the body is now an attachment\n");
         print_pdf(ln);
@@ -569,8 +569,8 @@
     int attach_num = 0;
     for (pst_item_attach* current_attach = item->attach; current_attach; current_attach = current_attach->next) {
         DEBUG_EMAIL(("Attempting Attachment encoding\n"));
-        if (!current_attach->data) {
-            DEBUG_EMAIL(("Data of attachment is NULL!. Size is supposed to be %i\n", current_attach->size));
+        if (!current_attach->data.data) {
+            DEBUG_EMAIL(("Data of attachment is NULL!. Size is supposed to be %i\n", current_attach->data.size));
         }
         string an = write_separate_attachment(f.name, current_attach, ++attach_num, pst);
         fprintf(dii_file, "@EATTACH %s\n", an.c_str());
@@ -588,7 +588,7 @@
     f.email_count  = 0;
     f.skip_count   = 0;
     f.type         = item->type;
-    f.stored_count = (item->folder) ? item->folder->email_count : 0;
+    f.stored_count = (item->folder) ? item->folder->item_count : 0;
     f.name         = ((parent) ? parent->name + "/" : "") + string(item->file_as.str);
 }