Changeset 3657
- Timestamp:
- 05/12/08 18:02:09
- Files:
-
- releases/modest/diablo-pe1/ChangeLog (modified) (4 diffs)
- releases/modest/diablo-pe1/libtinymail-camel/camel-lite/camel/camel-folder-summary.h (modified) (1 diff)
- releases/modest/diablo-pe1/libtinymail-camel/camel-lite/camel/camel-folder.c (modified) (1 diff)
- releases/modest/diablo-pe1/libtinymail-camel/tny-camel-send-queue.c (modified) (9 diffs)
- releases/modest/diablo-pe1/libtinymail-camel/tny-camel-transport-account.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
releases/modest/diablo-pe1/ChangeLog
r3653 r3657 1 2008-05-12 Rob Taylor <rob.taylor@codethink.co.uk> 2 3 * libtinymail/tny-error.c: Fix documentation 4 5 2008-05-12 Rob Taylor <rob.taylor@codethink.co.uk> 6 7 * m4/ticonv.m4: Add --with-iconv-detect-h option to allow the passing 8 of a pre-generated iconv-detect.h rather than generating it at 9 configure time. 10 11 2008-05-12 Rob Taylor <rob.taylor@codethink.co.uk> 12 13 * libtinymail-camel/tny-camel-bs-msg-receive-strategy.c: 14 * libtinymail-camel/tny-camel-folder.c: 15 * libtinymail-camel/tny-camel-nntp-folder.c: 16 * libtinymail-camel/tny-camel-mime-part.c: 17 * libtinymail-camel/tny-camel-send-queue.c: 18 * libtinymail-camel/tny-camel-pop-store-account.c: 19 * libtinymail-camel/tny-camel-pop-folder.c: 20 * libtinymail-camel/tny-camel-common.c: 21 * libtinymail-camel/tny-camel-nntp-store-account.c: 22 * libtinymail-camel/tny-camel-store-account.c: 23 * libtinymail-camel/tny-camel-transport-account.c: 24 * libtinymail-camel/tny-camel-account.c: 25 * libtinymail/tny-error.c: 26 * libtinymail/tny-error.h: 27 * libtinymail/tny-merge-folder.c: Fix tinymail's GError usage. Use an 28 actual GQuark for the domain, have one domain for tinymail as a whole. 29 Removes the pointless GType for the error. 30 1 31 2008-05-12 Sergio Villar Senin <svillar@igalia.com> 2 32 … … 4 34 sentbox and outbox while sending, as we can get unreasons and have 5 35 then crash because the message cache is freed. (Based on a previous 6 patch by Dape) .36 patch by Dape) 7 37 8 38 2008-05-09 Jose Dapena Paz <jdapena@igalia.com> … … 16 46 2008-05-06 Jose Dapena Paz <jdapena@igalia.com> 17 47 48 * libtinymail-camel/camel-lite/camel/camel-certdb-cst.c 49 Fix some leaks in CST certificate manager support. 50 51 * libtinymail-camel/tny-camel-folder.c: 52 Reason the camel folder while we're getting its size and count, 53 avoiding some crashes. 54 18 55 * libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c: 19 56 Protect PR_Reads and writes to avoid calls to PR_Close before one of … … 34 71 Use weak references to folders in accesses to store. 35 72 73 2008-04-30 Philip Van Hoof <pvanhoof@gnome.org> 74 75 * Enlarged a lock for the transport-account in camel 76 36 77 2008-04-30 Sergio Villar Senin <svillar@igalia.com> 37 78 38 79 * libtinymail-camel/tny-camel-send-queue.c: 39 (on_added): place correctly two swapped parameters when 40 calling the user callback 80 (on_added): place correctly two swapped parameters when calling the 81 user callback 82 83 2008-04-29 Philip Van Hoof <pvanhoof@gnome.org> 84 85 * Extra robustness in TnyCamelSendQueue 86 87 2008-04-29 Jose Dapena Paz <jdapena@igalia.com> 88 89 * libtinymail-camel/camel-lite/camel/camel-folder.c 90 (transfer_message_to): preserve flags on transferring the message to 91 a new folder. 92 93 * libtinymail-camel/camel-lite/camel/camel-folder-summary.h: 94 add some comments to flags enumeration to remember that it should be 95 kept sync with flags masks. 96 97 2008-04-28 Jose Dapena Paz <jdapena@igalia.com>, Sergio Villar Senin <svillar@igalia.com> 98 99 * libtinymail/tny-folder.[ch]: new method find_msg_async. This makes find_msg synchronous 100 version be deprecated now. 101 102 * libtinymail-camel/tny-camel-folder.[ch], 103 libtinymail/tny-merge-folder.[ch]: 104 Added implementations of find_msg_async method. 105 106 2008-04-25 Philip Van Hoof <pvanhoof@gnome.org> 107 108 * Error reporting when sending a message without From, and a crash-fix 109 about it too 110 * Added tny_camel_transport_account_get_from and 111 tny_camel_transport_account_set_from 112 113 * This was a minor API change 114 115 2008-04-24 Philip Van Hoof <pvanhoof@gnome.org> 116 117 * Removed all synchronous API usage in TnyCamelSendQueue 41 118 42 119 2008-04-24 Sergio Villar Senin <svillar@igalia.com> releases/modest/diablo-pe1/libtinymail-camel/camel-lite/camel/camel-folder-summary.h
r3526 r3657 73 73 CAMEL_MESSAGE_PARTIAL = 1<<7, /* used TNY_HEADER_FLAG_PARTIAL */ 74 74 CAMEL_MESSAGE_EXPUNGED = 1<<8, /* used TNY_HEADER_FLAG_EXPUNGED */ 75 76 /* CAMEL_MESSAGE_PRIORITY_MASK flags */ 75 77 CAMEL_MESSAGE_HIGH_PRIORITY = 0<<9|1<<10, /* used TNY_HEADER_FLAG_HIGH_PRIORITY */ 76 78 CAMEL_MESSAGE_NORMAL_PRIORITY = 0<<9|0<<10, /* used TNY_HEADER_FLAG_NORMAL_PRIORITY */ 77 79 CAMEL_MESSAGE_LOW_PRIORITY = 1<<9|0<<10, /* used TNY_HEADER_FLAG_LOW_PRIORITY */ 80 78 81 CAMEL_MESSAGE_SUSPENDED = 1<<11, /* TNY_HEADER_FLAG_SUSPENDED */ 79 82 80 /* internally used */ 83 /* WARNING: just keep updated the CAMEL_MESSAGE_SYSTEM_MASK and CAMEL_MESSAGE_PRIORITY_MASK 84 * to make them be sync'd */ 85 86 /* internally used (CAMEL_MESSAGE_SYSTEM_MASK flags)*/ 81 87 CAMEL_MESSAGE_INFO_NEEDS_FREE = 1<<13,/* internally used */ 82 88 CAMEL_MESSAGE_INFO_UNUSED = 1<<14, /* internally used but available */ releases/modest/diablo-pe1/libtinymail-camel/camel-lite/camel/camel-folder.c
r3615 r3657 1485 1485 camel_folder_free_message_info(source, minfo); 1486 1486 } else */ 1487 info = camel_message_info_new_from_header(NULL, ((CamelMimePart *)msg)->headers); 1487 info = camel_message_info_new_from_header(NULL, ((CamelMimePart *)msg)->headers); 1488 1489 /*copying flags */ 1490 if ((source->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY) && 1491 (minfo = camel_folder_get_message_info (source, uid))) { 1492 camel_message_info_set_flags (info, ~CAMEL_MESSAGE_SYSTEM_MASK, camel_message_info_flags (minfo)); 1493 camel_folder_free_message_info (source, minfo); 1494 } 1488 1495 1489 1496 /* we don't want to retain the deleted flag */ releases/modest/diablo-pe1/libtinymail-camel/tny-camel-send-queue.c
r3653 r3657 391 391 } 392 392 393 394 395 typedef struct { 396 TnyFolder *from, *to; 397 TnyList *list; 398 GError **err; 399 400 GCond* condition; 401 gboolean had_callback; 402 GMutex *mutex; 403 404 } TransferSync; 405 406 static void 407 transfer_async (TnyFolder *folder, gboolean cancelled, GError *err, gpointer user_data) 408 { 409 TransferSync *info = (TransferSync *) user_data; 410 411 if (err && info->err) 412 *info->err = g_error_copy (err); 413 414 g_mutex_lock (info->mutex); 415 g_cond_broadcast (info->condition); 416 info->had_callback = TRUE; 417 g_mutex_unlock (info->mutex); 418 } 419 420 static void 421 transfer_sync (TnyFolder *from, TnyList *list, TnyFolder *to, gboolean delete_originals, GError **err) 422 { 423 TransferSync *info = g_slice_new0 (TransferSync); 424 425 info->mutex = g_mutex_new (); 426 info->condition = g_cond_new (); 427 info->had_callback = FALSE; 428 429 info->from = g_object_ref (from); 430 info->to = g_object_ref (to); 431 info->list = g_object_ref (list); 432 info->err = err; 433 434 tny_folder_transfer_msgs_async (info->from, info->list, info->to, 435 delete_originals, transfer_async, NULL, info); 436 437 g_mutex_lock (info->mutex); 438 if (!info->had_callback) 439 g_cond_wait (info->condition, info->mutex); 440 g_mutex_unlock (info->mutex); 441 442 g_mutex_free (info->mutex); 443 g_cond_free (info->condition); 444 445 g_object_unref (info->from); 446 g_object_unref (info->to); 447 g_object_unref (info->list); 448 g_slice_free (TransferSync, info); 449 } 450 451 452 typedef struct { 453 TnyFolder *folder; 454 TnyHeader *header; 455 TnyMsg *msg; 456 GError **err; 457 458 GCond* condition; 459 gboolean had_callback; 460 GMutex *mutex; 461 462 } GetSync; 463 464 static void 465 get_async (TnyFolder *folder, gboolean cancelled, TnyMsg *msg, GError *err, gpointer user_data) 466 { 467 GetSync *info = (GetSync *) user_data; 468 469 if (err && info->err) 470 *info->err = g_error_copy (err); 471 472 if (msg) 473 info->msg = g_object_ref (msg); 474 475 g_mutex_lock (info->mutex); 476 g_cond_broadcast (info->condition); 477 info->had_callback = TRUE; 478 g_mutex_unlock (info->mutex); 479 } 480 481 static TnyMsg* 482 get_sync (TnyFolder *folder, TnyHeader *header, GError **err) 483 { 484 GetSync *info = g_slice_new0 (GetSync); 485 TnyMsg *retval = NULL; 486 487 info->mutex = g_mutex_new (); 488 info->condition = g_cond_new (); 489 info->had_callback = FALSE; 490 491 info->folder = g_object_ref (folder); 492 info->header = g_object_ref (header); 493 info->err = err; 494 495 tny_folder_get_msg_async (info->folder, info->header, 496 get_async, NULL, info); 497 498 g_mutex_lock (info->mutex); 499 if (!info->had_callback) 500 g_cond_wait (info->condition, info->mutex); 501 g_mutex_unlock (info->mutex); 502 503 g_mutex_free (info->mutex); 504 g_cond_free (info->condition); 505 506 if (info->msg) 507 retval = g_object_ref (info->msg); 508 509 g_object_unref (info->folder); 510 g_object_unref (info->header); 511 g_object_unref (info->msg); 512 513 g_slice_free (GetSync, info); 514 return retval; 515 } 516 517 518 519 520 typedef struct { 521 TnyFolder *folder; 522 GError **err; 523 524 GCond* condition; 525 gboolean had_callback; 526 GMutex *mutex; 527 528 } SyncSync; 529 530 static void 531 sync_async (TnyFolder *folder, gboolean cancelled, GError *err, gpointer user_data) 532 { 533 SyncSync *info = (SyncSync *) user_data; 534 535 if (err && info->err) 536 *info->err = g_error_copy (err); 537 538 g_mutex_lock (info->mutex); 539 g_cond_broadcast (info->condition); 540 info->had_callback = TRUE; 541 g_mutex_unlock (info->mutex); 542 } 543 544 static void 545 sync_sync (TnyFolder *self, gboolean expunge, GError **err) 546 { 547 SyncSync *info = g_slice_new0 (SyncSync); 548 549 info->mutex = g_mutex_new (); 550 info->condition = g_cond_new (); 551 info->had_callback = FALSE; 552 553 info->folder = g_object_ref (self); 554 info->err = err; 555 556 tny_folder_sync_async (info->folder, expunge, sync_async, NULL, info); 557 558 g_mutex_lock (info->mutex); 559 if (!info->had_callback) 560 g_cond_wait (info->condition, info->mutex); 561 g_mutex_unlock (info->mutex); 562 563 g_mutex_free (info->mutex); 564 g_cond_free (info->condition); 565 566 g_object_unref (info->folder); 567 g_slice_free (SyncSync, info); 568 } 569 393 570 static gpointer 394 571 thread_main (gpointer data) … … 431 608 { 432 609 TnyHeader *header = NULL; 433 TnyMsg *msg = NULL;434 610 435 611 g_static_rec_mutex_lock (priv->sending_lock); … … 520 696 TnyList *hassent = tny_simple_list_new (); 521 697 GError *err = NULL; 698 TnyMsg *msg = NULL; 522 699 523 700 tny_list_prepend (hassent, G_OBJECT (header)); 524 msg = tny_folder_get_msg (info->outbox, header, &err); 525 526 /* Emits msg-sending signal to inform a new msg is being sent */ 527 emit_control (self, header, msg, TNY_SEND_QUEUE_MSG_SENDING, i, priv->total); 528 529 if (err == NULL) 530 { 701 msg = get_sync (info->outbox, header, &err); 702 703 if (err == NULL) { 704 /* Emits msg-sending signal to inform a new msg is being sent */ 705 emit_control (self, header, msg, TNY_SEND_QUEUE_MSG_SENDING, i, priv->total); 706 531 707 _tny_camel_account_start_camel_operation (TNY_CAMEL_ACCOUNT (info->trans_account), 532 708 NULL, NULL, "Sending message"); … … 549 725 } 550 726 727 if (msg) 728 g_object_unref (msg); 729 msg = NULL; 730 551 731 g_static_rec_mutex_lock (priv->todo_lock); 552 732 { 553 if (err == NULL) 554 { 733 if (err == NULL) { 555 734 GError *newerr = NULL; 735 GError *serr = NULL; 556 736 priv->cur_i = i; 557 737 tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN); 558 738 tny_header_set_flag (header, TNY_HEADER_FLAG_ANSWERED); 559 tny_folder_transfer_msgs (info->outbox, hassent, info->sentbox, TRUE, &newerr); 739 740 sync_sync (info->outbox, TRUE, &serr); 741 if (serr) 742 g_error_free (serr); 743 744 transfer_sync (info->outbox, hassent, info->sentbox, TRUE, &newerr); 560 745 if (newerr != NULL) { 561 emit_error (self, header, msg, newerr, i, priv->total);746 emit_error (self, header, NULL, newerr, i, priv->total); 562 747 g_error_free (newerr); 563 748 } … … 609 794 g_object_unref (info->self); 610 795 796 if (TNY_IS_CAMEL_FOLDER (info->sentbox)) { 797 TnyCamelFolderPriv *spriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox); 798 _tny_camel_folder_unreason (spriv); 799 } 800 611 801 if (TNY_IS_CAMEL_FOLDER (info->outbox)) { 612 802 TnyCamelFolderPriv *opriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->outbox); 613 803 _tny_camel_folder_unreason (opriv); 614 }615 if (TNY_IS_CAMEL_FOLDER (info->sentbox)) {616 TnyCamelFolderPriv *spriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox);617 _tny_camel_folder_unreason (spriv);618 804 } 619 805 … … 659 845 if (!info->outbox || !info->sentbox) { 660 846 661 g_set_error (err, TNY_ SERVICE_ERROR,847 g_set_error (err, TNY_ERROR_DOMAIN, 662 848 TNY_SERVICE_ERROR_ADD_MSG, FOLDERSNOTREADY); 663 849 g_warning (FOLDERSNOTREADY); … … 677 863 info->trans_account = (TnyTransportAccount *) g_object_ref (priv->trans_account); 678 864 679 if (TNY_IS_CAMEL_FOLDER (info->outbox)) {680 TnyCamelFolderPriv *opriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->outbox);681 _tny_camel_folder_reason (opriv);682 }683 if (TNY_IS_CAMEL_FOLDER (info->sentbox)) {684 TnyCamelFolderPriv *spriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox);685 _tny_camel_folder_reason (spriv);686 }865 if (TNY_IS_CAMEL_FOLDER (info->outbox)) { 866 TnyCamelFolderPriv *opriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->outbox); 867 _tny_camel_folder_reason (opriv); 868 } 869 if (TNY_IS_CAMEL_FOLDER (info->sentbox)) { 870 TnyCamelFolderPriv *spriv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox); 871 _tny_camel_folder_reason (spriv); 872 } 687 873 688 874 emit_queue_control_signals (self, TNY_SEND_QUEUE_START); … … 848 1034 if (!outbox || !TNY_IS_FOLDER (outbox)) 849 1035 { 850 g_set_error (err, TNY_ SERVICE_ERROR,1036 g_set_error (err, TNY_ERROR_DOMAIN, 851 1037 TNY_SERVICE_ERROR_ADD_MSG, 852 1038 _("Operating can't continue: send queue not ready " … … 906 1092 907 1093 if (!outbox || !TNY_IS_FOLDER (outbox)) { 908 g_set_error (&err, TNY_ SERVICE_ERROR,1094 g_set_error (&err, TNY_ERROR_DOMAIN, 909 1095 TNY_SERVICE_ERROR_ADD_MSG, 910 1096 _("Operating can't continue: send queue not ready " releases/modest/diablo-pe1/libtinymail-camel/tny-camel-transport-account.c
r3480 r3657 251 251 camel_service_disconnect (apriv->service, TRUE, &ex); 252 252 253 g_static_rec_mutex_unlock (apriv->service_lock); 254 253 255 camel_object_unref (recipients); 254 256 camel_object_unref (from);
