@@ -294,20 +294,18 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
294294 strcmp (dir, pstore->get_dir ()) != 0 )
295295 return ;
296296
297- ZNOTIFICATION zn, *pnotification = &zn;
297+ ZNOTIFICATION zn, *pnotification = &zn, *pnew_mail = &zn, *oz = &zn ;
298298 switch (pdb_notify->type ) {
299299 case db_notify_type::new_mail: {
300300 pnotification->event_type = fnevNewMail;
301- auto pnew_mail = new NEWMAIL_ZNOTIFICATION;
302- pnotification->pnotification_data = pnew_mail;
303301 auto nt = static_cast <const DB_NOTIFY_NEW_MAIL *>(pdb_notify->pdata );
304302 folder_id = rop_util_nfid_to_eid (nt->folder_id );
305303 message_id = rop_util_make_eid_ex (1 , nt->message_id );
306- pnew_mail->entryid = cu_mid_to_entryid_s (*pstore, folder_id, message_id);
307- if (pnew_mail->entryid . empty ())
304+ pnew_mail->pentryid = cu_mid_to_entryid_s (*pstore, folder_id, message_id);
305+ if (pnew_mail->pentryid -> empty ())
308306 return ;
309- pnew_mail->parentid = cu_fid_to_entryid_s (*pstore, folder_id);
310- if (pnew_mail->parentid . empty ())
307+ pnew_mail->pparentid = cu_fid_to_entryid_s (*pstore, folder_id);
308+ if (pnew_mail->pparentid -> empty ())
311309 return ;
312310 static constexpr proptag_t proptag_buff[] = {PR_MESSAGE_CLASS, PR_MESSAGE_FLAGS};
313311 static constexpr PROPTAG_ARRAY proptags = {std::size (proptag_buff), deconst (proptag_buff)};
@@ -326,8 +324,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
326324 }
327325 case db_notify_type::folder_created: {
328326 pnotification->event_type = fnevObjectCreated;
329- auto oz = new OBJECT_ZNOTIFICATION;
330- pnotification->pnotification_data = oz;
331327 auto nt = static_cast <const DB_NOTIFY_FOLDER_CREATED *>(pdb_notify->pdata );
332328 folder_id = rop_util_nfid_to_eid (nt->folder_id );
333329 parent_id = rop_util_nfid_to_eid (nt->parent_id );
@@ -342,8 +338,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
342338 }
343339 case db_notify_type::message_created: {
344340 pnotification->event_type = fnevObjectCreated;
345- auto oz = new OBJECT_ZNOTIFICATION;
346- pnotification->pnotification_data = oz;
347341 auto nt = static_cast <const DB_NOTIFY_MESSAGE_CREATED *>(pdb_notify->pdata );
348342 folder_id = rop_util_nfid_to_eid (nt->folder_id );
349343 message_id = rop_util_make_eid_ex (1 , nt->message_id );
@@ -358,8 +352,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
358352 }
359353 case db_notify_type::folder_deleted: {
360354 pnotification->event_type = fnevObjectDeleted;
361- auto oz = new OBJECT_ZNOTIFICATION;
362- pnotification->pnotification_data = oz;
363355 auto nt = static_cast <const DB_NOTIFY_FOLDER_DELETED *>(pdb_notify->pdata );
364356 folder_id = rop_util_nfid_to_eid (nt->folder_id );
365357 parent_id = rop_util_nfid_to_eid (nt->parent_id );
@@ -374,8 +366,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
374366 }
375367 case db_notify_type::message_deleted: {
376368 pnotification->event_type = fnevObjectDeleted;
377- auto oz = new OBJECT_ZNOTIFICATION;
378- pnotification->pnotification_data = oz;
379369 auto nt = static_cast <const DB_NOTIFY_MESSAGE_DELETED *>(pdb_notify->pdata );
380370 folder_id = rop_util_nfid_to_eid (nt->folder_id );
381371 message_id = rop_util_make_eid_ex (1 , nt->message_id );
@@ -390,8 +380,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
390380 }
391381 case db_notify_type::folder_modified: {
392382 pnotification->event_type = fnevObjectModified;
393- auto oz = new OBJECT_ZNOTIFICATION;
394- pnotification->pnotification_data = oz;
395383 auto nt = static_cast <const DB_NOTIFY_FOLDER_MODIFIED *>(pdb_notify->pdata );
396384 folder_id = rop_util_nfid_to_eid (nt->folder_id );
397385 oz->object_type = MAPI_FOLDER;
@@ -402,8 +390,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
402390 }
403391 case db_notify_type::message_modified: {
404392 pnotification->event_type = fnevObjectModified;
405- auto oz = new OBJECT_ZNOTIFICATION;
406- pnotification->pnotification_data = oz;
407393 auto nt = static_cast <const DB_NOTIFY_MESSAGE_MODIFIED *>(pdb_notify->pdata );
408394 folder_id = rop_util_nfid_to_eid (nt->folder_id );
409395 message_id = rop_util_make_eid_ex (1 , nt->message_id );
@@ -420,8 +406,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
420406 case db_notify_type::folder_copied: {
421407 pnotification->event_type = pdb_notify->type == db_notify_type::folder_moved ?
422408 fnevObjectMoved : fnevObjectCopied;
423- auto oz = new OBJECT_ZNOTIFICATION;
424- pnotification->pnotification_data = oz;
425409 auto nt = static_cast <const DB_NOTIFY_FOLDER_MVCP *>(pdb_notify->pdata );
426410 folder_id = rop_util_nfid_to_eid (nt->folder_id );
427411 parent_id = rop_util_nfid_to_eid (nt->parent_id );
@@ -446,8 +430,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
446430 case db_notify_type::message_copied: {
447431 pnotification->event_type = pdb_notify->type == db_notify_type::message_moved ?
448432 fnevObjectMoved : fnevObjectCopied;
449- auto oz = new OBJECT_ZNOTIFICATION;
450- pnotification->pnotification_data = oz;
451433 auto nt = static_cast <const DB_NOTIFY_MESSAGE_MVCP *>(pdb_notify->pdata );
452434 old_parentid = rop_util_nfid_to_eid (nt->old_folder_id );
453435 old_eid = rop_util_make_eid_ex (1 , nt->old_message_id );
@@ -470,8 +452,6 @@ void zs_notification_proc(const char *dir, BOOL b_table, uint32_t notify_id,
470452 }
471453 case db_notify_type::search_completed: {
472454 pnotification->event_type = fnevSearchComplete;
473- auto oz = new OBJECT_ZNOTIFICATION;
474- pnotification->pnotification_data = oz;
475455 auto nt = static_cast <const DB_NOTIFY_SEARCH_COMPLETED *>(pdb_notify->pdata );
476456 folder_id = rop_util_nfid_to_eid (nt->folder_id );
477457 oz->object_type = MAPI_FOLDER;
0 commit comments