diff src/libpst.c @ 297:8b3a827b71f4

add alarm reminders to calendar events
author Carl Byington <carl@five-ten-sg.com>
date Thu, 28 Jul 2011 17:28:49 -0700
parents cc8ee701f190
children 201464dd356e
line wrap: on
line diff
--- a/src/libpst.c	Sun Jul 10 17:03:17 2011 -0700
+++ b/src/libpst.c	Thu Jul 28 17:28:49 2011 -0700
@@ -281,7 +281,7 @@
 static pst_mapi_object* pst_parse_block(pst_file *pf, uint64_t block_id, pst_id2_tree *i2_head);
 static void             pst_printDptr(pst_file *pf, pst_desc_tree *ptr);
 static void             pst_printID2ptr(pst_id2_tree *ptr);
-static int              pst_process(pst_mapi_object *list, pst_item *item, pst_item_attach *attach);
+static int              pst_process(uint64_t block_id, pst_mapi_object *list, pst_item *item, pst_item_attach *attach);
 static size_t           pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf);
 static int              pst_decrypt(uint64_t i_id, char *buf, size_t size, unsigned char type);
 static int              pst_stricmp(char *a, char *b);
@@ -1246,7 +1246,7 @@
     item = (pst_item*) pst_malloc(sizeof(pst_item));
     memset(item, 0, sizeof(pst_item));
 
-    if (pst_process(list, item, NULL)) {
+    if (pst_process(d_ptr->desc->i_id, list, item, NULL)) {
         DEBUG_WARN(("pst_process() returned non-zero value. That is an error\n"));
         pst_freeItem(item);
         pst_free_list(list);
@@ -1267,7 +1267,7 @@
                 attach->next = item->attach;
                 item->attach = attach;
             }
-            if (pst_process(list, item, item->attach)) {
+            if (pst_process(id2_ptr->id->i_id, list, item, item->attach)) {
                 DEBUG_WARN(("ERROR pst_process() failed with DSN/MDN attachments\n"));
                 pst_freeItem(item);
                 pst_free_list(list);
@@ -1299,7 +1299,7 @@
             attach->next = item->attach;
             item->attach = attach;
         }
-        if (pst_process(list, item, item->attach)) {
+        if (pst_process(id2_ptr->id->i_id, list, item, item->attach)) {
             DEBUG_WARN(("ERROR pst_process() failed with attachments\n"));
             pst_freeItem(item);
             pst_free_list(list);
@@ -1329,7 +1329,7 @@
                 }
                 // reprocess the same attachment list against new data
                 // this might update attach->id2_val
-                if (pst_process(list, item, attach)) {
+                if (pst_process(id2_ptr->id->i_id, list, item, attach)) {
                     DEBUG_WARN(("ERROR pst_process() failed with an attachment\n"));
                     pst_free_list(list);
                     continue;
@@ -2121,7 +2121,7 @@
  *
  * @return 0 for ok, -1 for error.
  */
-static int pst_process(pst_mapi_object *list, pst_item *item, pst_item_attach *attach) {
+static int pst_process(uint64_t block_id, pst_mapi_object *list, pst_item *item, pst_item_attach *attach) {
     DEBUG_ENT("pst_process");
     if (!item) {
         DEBUG_WARN(("item cannot be NULL.\n"));
@@ -2129,6 +2129,7 @@
         return -1;
     }
 
+    item->block_id = block_id;
     while (list) {
         int32_t x;
         char time_buffer[30];