aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-summary.c
Commit message (Collapse)AuthorAgeFilesLines
* turn this on, this should always be on, it points to real bugs in theNot Zed2004-04-021-6/+22
| | | | | | | | | | | | | 2004-04-02 Not Zed <NotZed@Ximian.com> * camel-exception.c (w): turn this on, this should always be on, it points to real bugs in the code. * camel-folder-summary.c (summary_build_content_info): dont set attachments if its a signature block. (summary_build_content_info_message): same. svn path=/trunk/; revision=25298
* See bug #55618.Not Zed2004-03-171-1/+2
| | | | | | | | | | | | | | | | | | | | 2004-03-17 Not Zed <NotZed@Ximian.com> * See bug #55618. * camel-disco-diary.c (camel_disco_diary_new): seek to the end of the file after we open it. c99 apparently says the file merely adds to the end of the file when you write, not that it is opened and positioned at the end of the file (linux's man pages are out of date). * camel-folder-summary.c (content_info_new): setup the content type as well, from the headers. * providers/imap/camel-imap-summary.c (camel_imap_summary_add_offline): copy size from the source info. svn path=/trunk/; revision=25096
* kill sum debugMichael Zucci2004-02-241-3/+3
| | | | svn path=/trunk/; revision=24841
* ** See bug #51045.Not Zed2004-02-161-18/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-02-16 Not Zed <NotZed@Ximian.com> ** See bug #51045. * providers/imap/camel-imap-store.c (fill_fi): similar to mbox version. (get_folder_counts): use fill_fi to try and get folder counts if we're not doing the hard slog. (get_one_folder_offline): use fill_fi to try to get folder counts from open folders or summaries. * providers/local/camel-maildir-store.c (fill_fi): similar to mbox version. (scan_dir): use fill_fi to get the unread count now. * providers/local/camel-mbox-store.c (fill_fi): helper to lookup unread count either from active folder or from summary file, if it's available. (scan_dir, get_folder_info): use helper above to get folder info. * devel-docs/camel-folder-summary.txt: New document describing the format/conventions in the CamelFolderSummary file. * providers/nntp/camel-nntp-summary.c (summary_header_load/save): * providers/imapp/camel-imapp-summary.c (summary_header_load/save): * providers/imap/camel-imap-summary.c (summary_header_load/save): Handle versions, per-class version number (1). * providers/local/camel-mbox-summary.c (summary_header_load/save): Handle versions properly, add a per-class version (1). Write out the folder size as a size_t rather than 32 bit int. * providers/local/camel-local-summary.c (summary_header_load/save): read/write the per-class version number (1). * camel-folder-summary.c (summary_header_load): do version checking differently, allow the version to be bumped without aborting the load. Added unread/deleted/junk counts to base header. (summary_header_save): Save out the new-format header. Version bumped to 13. * camel.c (camel_init): return 0 rather than spit a compiler warning. * camel-file-utils.c (camel_file_util_encode_*_t): macro-ise the type encoder/decoders. Also add size_t encoder/decoder. svn path=/trunk/; revision=24744
* merged spam filtering branchRadek Doulik2003-11-131-0/+1
| | | | svn path=/trunk/; revision=23302
* New function to replace the one from camel-mime-part.cJeffrey Stedfast2003-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-09-18 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (camel_transfer_encoding_to_string): New function to replace the one from camel-mime-part.c (camel_transfer_encoding_from_string): Same. (camel_content_transfer_encoding_decode): Renamed from camel_header_content_encoding_decode(). * camel-mime-part.c (camel_mime_part_encoding_to_string): Removed. (camel_mime_part_encoding_from_string): Removed. * camel-data-wrapper.[c,h]: updated for CamelTransferEncoding namespace changes * camel-folder-summary.c: updated for CamelTransferEncoding namespace changes * camel-mime-filter-bestenc.[c,h]: updated for CamelTransferEncoding namespace changes * camel-mime-message.c: updated for CamelTransferEncoding namespace changes * camel-mime-part-utils.c: updated for CamelTransferEncoding namespace changes * camel-multipart-signed.c: updated for CamelTransferEncoding namespace changes * camel-smime-context.c: updated for CamelTransferEncoding namespace changes * providers/imapp/camel-imapp-utils.c: updated for CamelTransferEncoding namespace changes * tests/lib/messages.c: updated for CamelTransferEncoding namespace changes * tests/message/test1.c: updated for CamelTransferEncoding namespace changes svn path=/trunk/; revision=22617
* s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g andJeffrey Stedfast2003-09-191-76/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-26 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and s/_header_state/_camel_mime_parser_state/g * camel-filter-driver.c: Same. * camel-folder-summary.c: Here too. * camel-http-stream.c: And here. * camel-mime-message.c: ... * camel-mime-part-utils.c: ... * camel-mime-part.c: ... * camel-movemail.c: ... * camel-multipart-signed.c: ... * camel-multipart.c: ... * providers/local/camel-mbox-folder.c: ... * providers/local/camel-mbox-summary.c: ... * providers/local/camel-mh-summary.c: ... * providers/nntp/camel-nntp-summary.c: ... * providers/pop3/camel-pop3-folder.c: ... 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22613
* temporarily reverting my camel namespace patches until after we merge in ↵Jeffrey Stedfast2003-08-271-76/+76
| | | | | | some of the other branches svn path=/trunk/; revision=22373
* s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g andJeffrey Stedfast2003-08-271-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-26 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and s/_header_state/_camel_mime_parser_state/g * camel-filter-driver.c: Same. * camel-folder-summary.c: Here too. * camel-http-stream.c: And here. * camel-mime-message.c: ... * camel-mime-part-utils.c: ... * camel-mime-part.c: ... * camel-movemail.c: ... * camel-multipart-signed.c: ... * camel-multipart.c: ... * providers/local/camel-mbox-folder.c: ... * providers/local/camel-mbox-summary.c: ... * providers/local/camel-mh-summary.c: ... * providers/nntp/camel-nntp-summary.c: ... * providers/pop3/camel-pop3-folder.c: ... svn path=/trunk/; revision=22365
* Namespaced.Jeffrey Stedfast2003-08-261-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22355
* Fix the range check, we were stopping removal of 1 or 2 removals, for someNot Zed2003-08-141-1/+1
| | | | | | | | | | | | | | | | | | 2003-08-13 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_remove_range): Fix the range check, we were stopping removal of 1 or 2 removals, for some odd and completely uncomprehensible reason. Perhaps debug left in? 2003-08-13 Not Zed <NotZed@Ximian.com> ** See bug #47517. * camel-vee-folder.c (vee_sync): Always rebuild folder on any sync, not just expunge ones. svn path=/trunk/; revision=22216
* New test suite for the mime parser (which is where the below 2 fixes wereJeffrey Stedfast2003-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/message/test4.c: New test suite for the mime parser (which is where the below 2 fixes were noticed). * camel-mime-parser.c (folder_boundary_check): Calculate 'len' by subtracting the boundary start from inend rather than 'atleast'. (folder_scan_content): Calculate 'inend' differently depending on the EOF state. 2003-08-08 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (html_convert): Rather than checking *inptr == '\n', check inptr >= inend - this gets rid of an Invalid Read report from valgrind. * camel-mime-part.c (write_to_stream): Don't necessarily re-encode just because the encodings differ. Need to look into making it so that message/rfc822 and multipart parts ignore the Content-Transfer-Encoding header and just keep their 'encoding' bits set to DEFAULT. 2003-08-05 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_content): Updated. * camel-mime-message.c (camel_mime_message_init): Don't override the mime_type here. (process_header): Updated to use CamelDataWrapper's mime_type field. (find_best_encoding): Same. (best_encoding): Here too. * camel-digest-folder.c (camel_digest_folder_new): Updated for CamelMimePart::content_type change. * camel-mime-part.c (camel_mime_part_init): Override our parent class's default mime_type. (camel_mime_part_finalize): Don't need to unref the content_type anymore. (process_header): Updated to use CamelDataWrapper's mime_type field. (camel_mime_part_set_filename): Same. (camel_mime_part_get_filename): Same. (camel_mime_part_get_content_type): Same. (set_content_object): Here too. (write_to_stream): Updated. (construct_from_parser): Updated. * camel-mime-part.h: Remove the content_type field. 2003-07-31 Jeffrey Stedfast <fejj@ximian.com> * tests/lib/messages.c (test_message_compare_content): If the chunks differ, perform a hexdump on the data being compared so that we may analyse it easier. * camel-multipart-signed.c (write_to_stream): Return ssize_t. * camel-mime-utils.h: Added the CamelMimePartEncodingType enum here. * camel-mime-part.h: Removed the CamelMimePartEncodingType enum from here. * camel-mime-part.c (write_to_stream): Updated to return ssize_t. Also minor changes to only re-encode the content stream if the charset or encoding changed (this way we write it out in the original raw form if nothing changed). * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Drastically simplify. We no longer scan html content to try and find the charset, nor do we care about converting the content to UTF-8 and handling broken windows charsets. * camel-mime-message.c (find_best_encoding): Use decode_to_stream() here. Also updated to not assume the content charset is UTF-8 since it is very likely not the case anymore since data-wrappers no longer are converted to UTF-8 at parse time. * camel-folder-summary.c (summary_build_content_info_message): Use decode_to_stream instead here too. * camel-folder-search.c (match_words_1message): Use decode_to_stream instead of write_to_stream so we can search the contents. * camel-data-wrapper.c (camel_data_wrapper_init): Set the default encoding to DEFAULT. (write_to_stream): Updated to return ssize_t (camel_data_wrapper_decode_to_stream): New virtual function to decode a data wrapper to a stream (results in nearly identical behaviour to the old write_to_stream method). (decode_to_stream): Default implementation of above virtual method. Decodes base64/qp/etc streams. * camel-data-wrapper.h: Removed the rawtext bit and added an encoding member. svn path=/trunk/; revision=22171
* Get rid of the #ifdef ENABLE_THREADS since we no longer plan toJeffrey Stedfast2003-07-101-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-07-09 Jeffrey Stedfast <fejj@ximian.com> * camel-block-file.c: Get rid of the #ifdef ENABLE_THREADS since we no longer plan to support/maintain this. * camel.c: Same. * camel-certdb.c: Here too. * camel-charset-map.c: And here. * camel-cipher-context.c: " * camel-data-wrapper.c: " * camel-digest-folder.c: " * camel-exception.c: " * camel-folder.c: " * camel-folder-summary.c: " * camel-lock-client.c: " * camel-mime-utils.c: " * camel-object.c: " * camel-operation.c: " * camel-partition-table.c: " * camel-sasl-popb4smtp.c: " * camel-service.c: " * camel-session.c: " * camel-store.c: " * camel-store-summary.c: " * camel-text-index.c: " * camel-transport.c: " * camel-vee-folder.c: " * camel-tcp-stream-openssl.c: Removed pthread.h, it isn't needed. svn path=/trunk/; revision=21777
* Updated for string-utils namespace changes.Jeffrey Stedfast2003-07-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-07-07 Jeffrey Stedfast <fejj@ximian.com> * camel-session.c (camel_session_init): Updated for string-utils namespace changes. * camel-provider.c: Updated for string-utils namespace changes. * camel-mime-part.c (init_header_name_table): Updated for string-utils namespace changes. * camel-mime-message.c (camel_mime_message_class_init): Updated for string-utils namespace changes. (camel_mime_message_init): Same. * camel-mime-filter-enriched.c (camel_mime_filter_enriched_class_init): Updated for string-utils namespace changes. * camel-folder-summary.c (camel_folder_summary_init): Updated for string-utils namespace changes. * camel-string-utils.[c,h]: Renamed from string-utils.[c,h] and also namespaced all functions. svn path=/trunk/; revision=21751
* Calculate ranges to remove folder info's more efficiently. affectsNot Zed2003-06-181-0/+42
| | | | | | | | | | | | | | | 2003-06-17 Not Zed <NotZed@Ximian.com> * camel-vee-folder.c (vee_folder_remove_folder): Calculate ranges to remove folder info's more efficiently. affects shutdown performance on big vfolders signifinantly. (vee_folder_build_folder): do the same here, when rebuilding a folder's definition. * camel-folder-summary.c (camel_folder_summary_remove_index): new function to drop a range of index entries in one hit. svn path=/trunk/; revision=21462
* Only display a warning if errno != EINVAL (EINVAL means there was aJeffrey Stedfast2003-05-201-8/+10
| | | | | | | | | | | | | | | 2003-05-19 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (camel_folder_summary_load): Only display a warning if errno != EINVAL (EINVAL means there was a version mismatch, so we don't really need to warn here since we are supposed to be able to handle this situation). (perform_content_info_load): Turn off debugging message. (summary_assign_uid): Turn off uid-clash warning. (camel_folder_summary_decode_token): Turn off debug messages. (summary_header_load): Turn off version-mismatch warning. svn path=/trunk/; revision=21284
* Ensure cmdbuf is initialized to avoid compiler warning.Jeremy Katz2003-05-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-05-16 Jeremy Katz <katzj@redhat.com> * providers/smtp/camel-smtp-transport.c (smtp_helo): Ensure cmdbuf is initialized to avoid compiler warning. * providers/local/camel-mbox-summary.c (summary_header_load): Cast folder_size to uint32 to fix warning. (camel_mbox_summary_sync_mbox): Update for new API. * providers/imap/camel-imap-utils.c (parse_params): imap_parse_nstring expects size_t, not int (imap_body_decode): Likewise. * camel-stream-filter.c (do_read): presize needs to be size_t instead of int. (do_write): Likewise. * camel-seekable-substream.c (stream_read): Return ssize_t instead of int to match prototypes. (stream_write): Likewise. * camel-mime-part.c (construct_from_parser): len needs to be size_t instead of int. * camel-mime-parser.c (folder_scan_step): datalength needs to be a size_t* instead of an int* to make dependent APIs safe. (camel_mime_parser_step): Likewise. (folder_scan_content): Likewise. * camel-mime-parser.h: Likewise. * camel-mime-message.c (camel_mime_message_class_init): Use glib macro for pointer/int conversions. (construct_from_parser): Update for new API. * camel-folder-summary.c (camel_folder_summary_info_new_from_parser): Update len to be size_t for new API. (summary_build_content_info): Likewise. * camel-http-stream.c (http_get_headers): Likewise. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Likewise. * camel-multipart-signed.c (signed_construct_from_parser): Likewise. * camel-multipart.c (construct_from_parser): Likewise. * camel-folder-search.c (match_words_index): Use glib macros for pointer/int conversions. * camel-html-parser.c (tokenise_setup): Likewise. (convert_entity): Likewise. * camel-block-file.c (block_hash_func): Likewise. (camel_block_file_get_block): Likewise. (camel_block_file_get_block): Likewise. (camel_block_file_detach_block): Likewise. * camel-session.c (session_thread_msg_new): Likewise. (session_thread_msg_free): Likewise. (session_thread_wait): Likewise. * camel-text-index.c (text_index_compress_nosync): Likewise. (text_index_compress_nosync): Likewise. (camel_text_index_validate): Likewise. * camel-vee-folder.c (vee_folder_remove_folder): Likewise. (unmatched_check_uid): Likewise. (folder_added_uid): Likewise. (vee_folder_build_folder): Likewise. (folder_changed_add_uid): Likewise. (folder_changed_remove_uid): Likewise. * providers/imap/camel-imap-search.c (imap_body_contains): Likewise. * providers/pop3/camel-pop3-folder.c (cmd_list): Likewise. (cmd_uidl): Likewise. * camel-data-cache.c (data_cache_init): Cast to CamelCopyFunc. Fixes a warning. svn path=/trunk/; revision=21220
* use g_strerror, and use errno directly rather than ferrno().Not Zed2003-04-081-1/+2
| | | | | | | | | | 2003-04-08 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_load): use g_strerror, and use errno directly rather than ferrno(). (summary_header_load): set errno when we get a version mismatch. svn path=/trunk/; revision=20739
* Handle raw 8-bit From data "correctly". (The same way we handleDan Winship2003-03-211-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw 8-bit Subject data.) * camel-mime-utils.c (header_decode_mailbox): Take a charset arg and pass it to header_decode_string. (header_decode_address): Take a charset arg and pass it to header_decode_mailbox. (header_mailbox_decode): Likewise. (header_address_decode): Take a charset arg and pass it to header_decode_address. * camel-folder-summary.c (summary_format_address): Take a charset arg and pass to header_address_decode. (message_info_new, camel_message_info_new_from_header): Pass charset to summary_format_address * camel-internet-address.c (internet_decode): Update for header_address_decode change. (Unfortunately we don't have a charset to pass here.) * camel-mime-message.c (camel_mime_message_build_mbox_from): Move this here from camel-mbox-summary since the same functionality is needed by evolution-mail too (and update for header_address_decode change) * providers/local/camel-mbox-summary.c (camel_mbox_summary_build_from): Moved to CamelMimeMessage svn path=/trunk/; revision=20430
* Same as the ones below.Jeffrey Stedfast2003-02-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-message.c: Same as the ones below. * camel-mime-part.c: Reverted back to pre-camel-iconv * camel-filter-search.c: Same as below. * camel-folder-summary.c: Reverted back to pre-camel-iconv * camel.c (camel_init): Reverted to pre-camel-iconv * camel-charset-map.c (camel_charset_locale_name): Removed (part of the revert). (camel_charset_canonical_name): Same. * camel-mime-filter-charset.c: Revert back to using e_iconv from GAL. * camel-mime-part-utils.c: Revert back to using e_iconv from GAL. * camel-mime-utils.c: Revert back to using e_iconv from GAL. * camel-sasl-digest-md5.c: Revert back to using e-iconv from GAL. svn path=/trunk/; revision=20056
* fixJeffrey Stedfast2003-02-211-1/+1
| | | | svn path=/trunk/; revision=19983
* Call camel_iconv_init(). (camel_shutdown): Call camel_iconv_shutdown().Jeffrey Stedfast2003-02-211-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-20 Jeffrey Stedfast <fejj@ximian.com> * camel.c (camel_init): Call camel_iconv_init(). (camel_shutdown): Call camel_iconv_shutdown(). * camel-sasl-digest-md5.c (digest_response): Updated to use camel-iconv and the new camel-charset-map functions. * camel-mime-utils.c: Updated to use camel-iconv and the new camel-charset-map functions. * camel-mime-part-utils.c (check_html_charset): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. (convert_buffer): Use camel-iconv. (simple_data_wrapper_construct_from_parser): Since camel_charset_iso_to_windows() returns the charset in it's canonical format, no need to re-canonicalise it. * camel-mime-part.c (process_header): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. * camel-mime-message.c (process_header): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. * camel-mime-filter-charset.c: Use camel-iconv. * camel-folder-summary.c (message_info_new): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. (content_info_new): Use camel_charset_locale_name(). (camel_message_info_new_from_header): Same as message_info_new(). * camel-search-private.c: Use g_alloca() instead of alloca(). * camel-filter-search.c (check_header): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. * camel-charset-map.c (camel_charset_locale_name): New function, replaces e_iconv_locale_charset(). (camel_charset_canonical_name): New function, similar to e_iconv_charset_name() but instead of returning the iconv-friendly name, it returns the canonical name. (g_iconv will do the iconv-friendly name conversions for us). svn path=/trunk/; revision=19977
* Use g_strerror when setting an exception string (we need it to be inJeffrey Stedfast2002-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-spool-summary.c (spool_summary_sync_full): Use g_strerror when setting an exception string (we need it to be in UTF-8). (spool_summary_check): Here too. * providers/local/camel-spool-store.c (construct): Use g_strerror when setting an exception string (we need it to be in UTF-8). (get_folder): Same. (scan_dir): Here too. * providers/local/camel-spool-folder.c (spool_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-summary.c (mh_summary_check): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-store.c (delete_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mbox-summary.c (summary_update): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_summary_sync_full): Here too. (mbox_summary_sync_quick): Same. (mbox_summary_sync): Also here. (camel_mbox_summary_sync_mbox): Again here. * providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_append_message): Same. (mbox_get_message): Here too. * providers/local/camel-maildir-summary.c (maildir_summary_load): Use g_strerror when setting an exception string (we need it to be in UTF-8). (maildir_summary_check): Same. * providers/local/camel-maildir-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (delete_folder): Same. (delete_folder): Here too. * providers/local/camel-local-summary.c (local_summary_sync): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-local-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (create_folder): Same. (xrename): Here too. (rename_folder): And here. (delete_folder): Also here. * camel-provider.c (camel_provider_init): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-movemail.c (camel_movemail): Use g_strerror when setting an exception string (we need it to be in UTF-8). (movemail_external): Same. (camel_movemail_copy_file): Here too. (camel_movemail_solaris): Also here. * camel-mime-utils.c (rfc2047_decode_word): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (header_encode_param): Same. * camel-mime-part-utils.c (convert_buffer): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-lock-client.c (camel_lock_helper_init): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-data-cache.c (camel_data_cache_remove): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (flaky_tcp_read): Same. * camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-service.c (camel_gethostbyname): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-lock.c (camel_lock_dot): Use g_strerror when setting an exception string (we need it to be in UTF-8). (camel_lock_fcntl): Same. svn path=/trunk/; revision=18689
* Removed hash-table-utils.[c,h] from the build.Jeffrey Stedfast2002-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-10-31 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Removed hash-table-utils.[c,h] from the build. * hash-table-utils.[c,h]: Removed. * string-util.c: Imported g_strcase[hash,equal] into here so we can remove hash-table-utils.[c,h]. * camel-medium.c: Removed #include "hash-table-utils.h" * camel-mime-message.c: Same here. * camel-mime-part.c: And here. * camel-session.c: Here too. * providers/imap/camel-imap-store-summary.c: #include string-utils.h instead of hash-table-utils.h * camel-charset-map.c: Same. * camel-folder-summary.c: Here too. * camel-provider.c: Again here. * camel-store-summary.c: And again... svn path=/trunk/; revision=18473
* Remove a ton of useless snot.Jeffrey Stedfast2002-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-10-31 Jeffrey Stedfast <fejj@ximian.com> Remove a ton of useless snot. * Makefile.am: Remove gstring-util.[c,h] from the build. * gstring-util.[c,h]: Removed. * string-utils.c (string_equal_for_glist): Removed. (string_split): Removed. (string_trim): Removed. (string_prefix): Removed. (string_unquote): Removed. (strip): Removed. * hash-table-utils.c (g_hash_table_generic_free): Removed. g_str[n]casecmp functions are deprecated in glib2. * string-utils.c (strstrcase): Use strncasecmp instead of g_strncasecmp. * hash-table-utils.c (g_strcase_equal): Use strcasecmp instead of g_strcasecmp. * camel-smime-utils.c (camel_smime_is_smime_v3_signed): Same. (camel_smime_is_smime_v3_encrypted): Here too. * camel-sasl-digest-md5.c (decode_data_type): And here. (parse_server_challenge): Again here. * camel-pgp-mime.c (camel_pgp_mime_is_rfc2015_signed): Same. (camel_pgp_mime_is_rfc2015_encrypted): Same * camel-mime-part-utils.c (check_html_charset): Here too. * camel-folder-summary.c (camel_system_flag): Same. svn path=/trunk/; revision=18472
* Remove debug content_info_dump, could cause a crash, and not really neededNot Zed2002-09-301-2/+5
| | | | | | | | | | | | | 2002-09-30 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (imap_get_message): Remove debug content_info_dump, could cause a crash, and not really needed anymore. * camel-folder-summary.c (camel_content_info_dump): Check ci->type != NULL before dereferencing it. Should fix crash #31331. svn path=/trunk/; revision=18259
* Same as below. Also save errno before closing the file so our caller canJeffrey Stedfast2002-09-111-1/+2
| | | | | | | | | | | | | | | | | | | | 2002-09-10 Jeffrey Stedfast <fejj@ximian.com> * camel-store-summary.c (camel_store_summary_load): Same as below. Also save errno before closing the file so our caller can figure out why we failed. (camel_store_summary_save): Same here, but also flush the output stream to disk. * camel-folder-summary.c (camel_folder_summary_load): s/fclose(in) == -1/fclose(in) != 0/ since fclose doesn't necessarily return -1 on fail, all we really know is that it returns 0 on success and non-zero on fail. * camel-certdb.c (camel_certdb_save): fsync() the stream after we fflush it. svn path=/trunk/; revision=18037
* Do proper error checking and return -1 on fail.Jeffrey Stedfast2002-09-111-30/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | 2002-09-10 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (perform_content_info_save): Do proper error checking and return -1 on fail. (camel_folder_summary_save): Check the return of perform_content_info_save and a few other output calls within the message_info_save loop. If any of them fail, save errno, close the file, and return -1. If we finish the loop without fail, fflush the stream and then fsync (fflush only flushes user-space buffers, you still need to fsync afterward to flush the data to disk). If either fail, treat it as an exception by saving errno, closing the stream, and returning -1. I suspect that this also fixes bug #30150 because the old code would fclose if fflush or fclose failed in the check after the loop (man fclose(3) states that any further calls using the stream (even another call to fclose) will have undefined behaviour no matter what the first fclose call returned). * providers/local/camel-local-summary.c (camel_local_summary_init): Don't malloc a private struct of 0 size. svn path=/trunk/; revision=18036
* revert jeff's patch below, and do it slightly differently, and stop theNot Zed2002-08-021-42/+28
| | | | | | | | | | | | | | | | | | 2002-08-02 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (message_info_load): revert jeff's patch below, and do it slightly differently, and stop the auto-reformatting bullshit. 2002-08-02 Not Zed <NotZed@Ximian.com> * providers/local/camel-maildir-summary.c (message_info_new): If we get a duplicate, just re-use the old info. (remove_summary): Add any removed to a change list. (maildir_summary_check): If we find new ones in 'cur' track them in the change list. Removed FIXME about it. For #18348. svn path=/trunk/; revision=17685
* Do more error checking to prevent crashing if we fail to read a string forJeffrey Stedfast2002-08-021-28/+44
| | | | | | | | | | 2002-08-01 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (message_info_load): Do more error checking to prevent crashing if we fail to read a string for example. svn path=/trunk/; revision=17672
* When writing the summary, use TRUNC flag, duh. Also, write to a temp fileNot Zed2002-07-241-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | 2002-07-25 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_save): When writing the summary, use TRUNC flag, duh. Also, write to a temp file first, and rename when closed successfully, and check ferror() and fclose() against 0 rather than -1. * providers/local/camel-mbox-summary.c (summary_update): Decrement i if we remove the summary item so we dont skip every 2nd one. * camel-mime-utils.c (header_decode_mailbox): Use rfc2047_decode_word explicitly incase we just found an encoded word. Stops us re-decoding the string twice, which fixes memory corruption in #26330 when the HUGE string is used later. 2002-07-24 Not Zed <NotZed@Ximian.com> * camel-partition-table.c (camel_key_table_next): Didn't unlock if we exited on an empty key list. svn path=/trunk/; revision=17570
* Only assign a uid if indexing is enabled. This stops us always assigning aNot Zed2002-07-151-2/+3
| | | | | | | | | | | | | | | | | | | | | 2002-07-13 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_info_new_from_message): Only assign a uid if indexing is enabled. This stops us always assigning a uid in the imap folder and disco folder? * providers/imap/camel-imap-folder.c (imap_update_summary): Also check the uid is set at all, another bit of a fix for #15667. 2002-07-09 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (imap_update_summary): Check for existing messages of the same uid before doing anything. If it exists, do nothing (perhaps it should merge?). A dirty hack for #15667. svn path=/trunk/; revision=17450
* Include <sys/time.h> for struct timeval.Not Zed2002-06-261-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-06-26 Not Zed <NotZed@Ximian.com> * camel-gpg-context.c: Include <sys/time.h> for struct timeval. * providers/local/camel-local-provider.c (camel_provider_module_init): Removed spoold provider. The spool provider does it now. 2002-06-25 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-folder.c (camel_spool_folder_new): Support a new xstatus option - folders update/honour the Status/X-Status headers in addition to X-Evolution. * providers/local/camel-local-summary.c (camel_local_summary_write_headers): If supplied with an additional status or xstatus arg, write a Status header and/or X-Status. Also fix the case of properly terminating the headers if an xev line isn't supplied. * providers/local/Makefile.am (libcamellocalinclude_HEADERS,SOURCES): Removed spoold-store.[ch]. * providers/local/camel-local-provider.c (camel_provider_module_init): For the spoold type, just use the spool store instead. * providers/local/camel-spool-store.h: Added a type field, so the 1 store can implement different types without having to subclass. * providers/local/camel-spool-store.c (camel_spool_store_get_toplevel_dir): Removed, inherits from local store now. (construct): If we're pointing to a file, treat it as mbox mode, otherwise treat it as 'elm' mode. (get_folder): Only test for INBOX in mbox mode. (get_folder_info_elm): (get_folder_info_mbox): Two alternatives for getting folder info, depending on the type of folder we're looking at. (get_folder_info_mbox): Make the url include the protocol. (scan_dir): " * providers/local/camel-spoold-store.c (camel_spoold_store_get_toplevel_dir): Removed, inherits from local store now. * camel-folder.c (get_message_user_tag): Dont use a g_return_if_fail for info==NULL. This is not an error. (set_message_user_tag): And same here. (set_message_user_flag): Sigh, and here. (get_message_user_flag): And here. (set_message_flags): and here ... (get_message_flags): Dum de dum, de done at last. * providers/local/camel-mbox-folder.c (mbox_get_message): Check for new messages whenever we retrieve one. In the common no-update case, this is a single stat. (mbox_get_message): If we need to rescan, then force a full rescan to make sure it does the right thing. (mbox_get_message): Cleanup the exception handling a bit, if we do get an error, propagate any folder changes anyway as well. (mbox_set_message_user_flag): Argh more of these stupid g_returns taht shouldn't be. (mbox_set_message_user_tag): Here too. (mbox_set_message_flags): If the read flag is being changed, mark it as an xevchange (i.e. Status line change). * providers/local/camel-mbox-summary.c (summary_rebuild): Merged into summary_update. (summary_update): Changed to allow it to update existing lists of messages without clearing out the summary. (mbox_summary_check): Dont clear the summary, just re-scan. (message_info_new): Attempt to support the 'Status: RO' elm/pine thing. (camel_mbox_summary_encode_status): (camel_mbox_summary_decode_status): Util functions for creating/parsing the Status line. (camel_mbox_summary_sync_mbox): Write out the status line if we're going to try support it. (camel_mbox_summary_xstatus): Implement option to control read/write of (x-)status. (message_info_new): Do x-status stuff based on run-time option. (camel_mbox_summary_sync_mbox): " (mbox_summary_add): If x-status enabled, then always add status/x-status headers to message. * camel-folder-summary.c (summary_assign_uid): If the messageinfo is already in the summary, AND is the same messageinfo, dont do anything, return a value to indicate this. (camel_folder_summary_add): Do nothing if this info already in the summary, so we can perform updates. 2002-06-24 Not Zed <NotZed@Ximian.com> * providers/local/camel-local-summary.c (camel_local_summary_check_force): New method to force the next summary check to be a full check, set if a mismatch occurs. * camel-folder-summary.c (camel_folder_summary_load): If we have no summary path set, dont do any i/o, rather than abort. (camel_folder_summary_save): " (camel_folder_summary_header_load): " * providers/local/camel-spool-store.h: Inherit from camel mbox store, even if we override almost everything. * providers/local/camel-local-folder.c (camel_local_folder_construct): If the base path points to a file, use that as the folder path as well. * providers/local/camel-spool-folder.h: Inherit from camel-mbox-folder. * providers/local/camel-spool-summary.c (spool_summary_sync_full): Use camel_mbox_summary_sync_mbox to do most of the work. * providers/local/camel-spool-summary.[ch]: Make spool-summary inherit from mbox summary rather than foldersummary. * providers/local/camel-mbox-summary.c (mbox_summary_sync): Make sync_full/quick virtual methods. (camel_mbox_summary_sync_mbox): The full sync method put into a simple function that sync's from fd to fd. (mbox_summary_sync_full): Use summary_sync_mbox to do the real work. (mbox_summary_check): Create removed events if the folder gets cleared. Also, dont clear the summary before a rebuild, try to merge. svn path=/trunk/; revision=17284
* Fixes bug #24136.Jeffrey Stedfast2002-05-151-18/+18
| | | | | | | | | | | | | | | | | | | | 2002-05-14 Jeffrey Stedfast <fejj@ximian.com> Fixes bug #24136. * providers/imap/camel-imap-folder.c (content_info_get_part_spec): New function to take a CamelMessageContentInfo and generate a part-specification string. (get_content): Stop passing around part_spec strings and use content_info_get_part_spec instead. * camel-folder-summary.c (camel_content_info_dump): Made this into a public debugging function. * providers/imap/camel-imap-utils.c (imap_parse_body): Make sure to set the parent of any message/rfc822 subparts. svn path=/trunk/; revision=16793
* Simplified since we can now decode in-reply-to without getting extraJeffrey Stedfast2002-04-051-24/+4
| | | | | | | | | | | | | | | | | 2002-04-04 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (message_info_new): Simplified since we can now decode in-reply-to without getting extra cruft. Get rid of the FIXME about having to check scan->id because of the possibility of it being NULL, this can no longer happen. * camel-mime-utils.c (header_references_inreplyto_decode): New function to decode in-reply-to headers. Only grabs the first thing that looks like a message-id and then returns. (header_references_decode): Loop calling header_references_decode_single (a new internal function). svn path=/trunk/; revision=16361
* Handle a ton more nspr i/o errno's. (stream_connect): Act as if we areJeffrey Stedfast2002-04-031-5/+34
| | | | | | | | | | | | | | | | | | | | | | 2002-04-02 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-ssl.c (set_errno): Handle a ton more nspr i/o errno's. (stream_connect): Act as if we are doing a non-blocking connect. This is to try and work around bug #15120 where users get an EINPROGRESS error. Maybe importing a PRFileDesc into SSL mode automagically makes it non-blocking? I dunno. 2002-04-01 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (message_info_new): Updated the construction of the references to match JWZ's updated algorithm initialization (ie, append any In-Reply-To reference onto any References header and never take more than a single message-id from the In-Reply-To header since anything after the first will probably just be email addresses). Fixes bug #1336. svn path=/trunk/; revision=16327
* When we add a new name, up all of the cache limits, because we're probablyNot Zed2002-03-251-114/+70
| | | | | | | | | | | | | | | | | | | 2002-03-25 Not Zed <NotZed@Ximian.com> * camel-text-index.c (text_index_add_name): When we add a new name, up all of the cache limits, because we're probably going to be adding more. (text_index_sync): Drop the cache limits back down again, we dont need them when looking words up. ** MERGE camel_index branch. * camel-text-index.[ch]: Added files i forgot to add (eep nearly lost all this work!) * camel-block-file.c (sync_nolock): Fix an infinite loop in syncing. svn path=/trunk/; revision=16242
* Use the date in the received header for the received_date.Jeffrey Stedfast2002-03-221-6/+17
| | | | | | | | | 2002-03-21 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (camel_message_info_new_from_header): Use the date in the received header for the received_date. svn path=/trunk/; revision=16225
* Now takes a url argument.Jeffrey Stedfast2002-03-131-2/+6
| | | | | | | | | | | | | | | | | | | 2002-03-12 Jeffrey Stedfast <fejj@ximian.com> * camel-digest-store.c (camel_digest_store_new): Now takes a url argument. * camel-digest-folder.c (digest_add_multipart): Fixed some memory corruption and also modified to use CAMEL_IS_MIME_MESSAGE() rather than comparing content-type strings. (digest_get_message): Fixed a logic blooper. * camel-folder-summary.c (camel_message_info_new_from_header): Set the date fields of the CamelMessageInfo as well. This may even fix some filter-related bugs where the user was trying to compare dates. svn path=/trunk/; revision=16126
* Don't #include camel-mime-filter-save.h, we don't use it.Jeffrey Stedfast2002-02-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 2002-02-27 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.h: Don't #include camel-mime-filter-save.h, we don't use it. * camel-file-utils.c: Fixed a few 'might be used uninitialized' warnings which were real problems. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Save the raw mime stream for any/all signed parts. * camel-mime-part.c (camel_mime_part_init): Initialize our raw stream to NULL. (camel_mime_part_finalize): Unref our raw stream, if we have one. (write_to_stream): If we have a raw stream, write that out instead of re-encoding. * camel-mime-filter-save.[c,h]: Rewritten to save to a stream rather than a file. svn path=/trunk/; revision=15867
* Remove the CAMEL_MESSAGE_NEEDS_REPLY flag, we no longer will be usingJeffrey Stedfast2002-02-071-1/+0
| | | | | | | | | 2002-02-06 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.h: Remove the CAMEL_MESSAGE_NEEDS_REPLY flag, we no longer will be using this. svn path=/trunk/; revision=15586
* If we don't want to corrupt the uuencoded data by overwriting it withJeffrey Stedfast2002-01-171-0/+9
| | | | | | | | | | | | | | 2002-01-16 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-basic.c (filter): If we don't want to corrupt the uuencoded data by overwriting it with base64 decoded data afterward, we need to add a break statement! * camel-folder-summary.c (summary_build_content_info): Add code to add a uu filter. (camel_folder_summary_finalize): Unref the uuencode filter. svn path=/trunk/; revision=15347
* Don't try setting a content-type parameter if either the name or value isJeffrey Stedfast2002-01-051-2/+5
| | | | | | | | | | | 2001-12-12 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (content_info_load): Don't try setting a content-type parameter if either the name or value is NULL. * camel-mime-utils.c (header_set_param): NULL-protection. svn path=/trunk/; revision=15248
* Implements marking messages as "Need Reply".Jon Trowbridge2001-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements marking messages as "Need Reply". 2001-12-09 Jon Trowbridge <trow@ximian.com> * mail-need-reply.xpm: Added a really, really ugly and awful icon to symbolize "message needs a reply". * Makefile.am (EXTRA_DIST): Added mail-need-reply.xpm. 2001-12-09 Jon Trowbridge <trow@ximian.com> * camel-folder-summary.c: Add "NeedsReply" to the flag_names array for CAMEL_MESSAGE_NEEDS_REPLY. * camel-folder-summary.h: Added CAMEL_MESSAGE_NEEDS_REPLY flag. 2001-12-09 Jon Trowbridge <trow@ximian.com> * vfoldertypes.xml: Add "Needs Reply" option to different status types. * filtertypes.xml: Add "Needs Reply" option to different status types. 2001-12-09 Jon Trowbridge <trow@ximian.com> * message-list.c: #include "art/mail-need-reply.xpm". (ml_tree_value_at): Adjust magic numbers, show "Need Reply" icon if the message needs reply. (message_list_create_extras): Adjust magic numbers to add new icon. (on_click): Changed to toggle between unread, read, and need reply when the status icon is clicked. * mail-callbacks.c (mark_as_needing_reply): Added. (mark_as_not_needing_reply): Added. Add "set" value to struct post_send_data. (composer_sent_cb): Use both "flags" and "set" elements of post_send_data when setting message flags. (mail_reply): Clear "Needs Reply" flag when we actually reply to a message. * folder-browser.c: Changed flag values to be given by bit-shifting (1<<5) vs. base-ten (32). Added CAN_MARK_DOESNT_NEED_REPLY flag. Added "Mark as Needing Reply" and "Mark as Not Needing Reply" elements to context menu. (on_right_click): Hide "Mark as (Not) Needing Reply" context menu elements as appropriate. svn path=/trunk/; revision=14946
* Use the uid rather than vuid for unmatched. Also add the uid to unmatched42001-12-011-11/+9
| | | | | | | | | | | | | | | | | | 2001-11-14 <NotZed@Ximian.com> * camel-vee-folder.c (folder_changed_remove_uid): Use the uid rather than vuid for unmatched. Also add the uid to unmatched if it wasn't in the unmatched_uids table at all. (folder_changed_change): If checking for added, if the new ones dont match, then try to add them to unmatched. Fixes #6893. * camel-folder-summary.c (camel_folder_summary_index): Change lock order, always summary_lock before ref_lock. (camel_folder_summary_array): " (camel_folder_summary_uid): " (camel_folder_summary_remove_uid): " Fixes a deadlock. svn path=/trunk/; revision=14831
* More fixing of the license texts.Ettore Perazzoli2001-10-281-12/+11
| | | | svn path=/trunk/; revision=14217
* Removed charset/locale charset lookup and iconv_open/close functions,12001-10-121-3/+5
| | | | | | | | | 2001-10-11 <NotZed@Ximian.com> * camel-charset-map.[ch]: Removed charset/locale charset lookup and iconv_open/close functions, moved to gal. Fixed all callers. svn path=/trunk/; revision=13602
* Implement.92001-10-101-2/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-10-09 <NotZed@Ximian.com> * providers/local/camel-spool-folder.c (spool_search_by_uids): Implement. * providers/imap/camel-imap-search.c (imap_body_contains): If searching a sub-set of the total message count, then use a UID range to search only specific messages. * camel-vee-folder.c (vee_folder_change_match): Removed. (folder_changed_add_uid): Helper func for changed code. (folder_changed_remove_uid): " (folder_changed_change_uid): " (folder_changed): Rewritten. Supports proper auto-updating of changes, but not removals till a sync occurs. (vee_search_by_uids): Implement. (folder_changed): Changed to call an async threaded function to do the actual folder updating. * camel-folder-summary.c (camel_flag_list_copy): New func to copy a whole list of flags. (camel_tag_list_copy): New func to copy a whole list of flags. * providers/imap/camel-imap-folder.c (imap_search_by_uids): Implement. * providers/local/camel-local-folder.c (local_search_by_uids): Implement. * camel-folder.c (camel_folder_search_by_uids): New function, search a subset of uid's. (search_by_uids): Default impl, return error. svn path=/trunk/; revision=13532
* If the type is encoded, get the fallback charset from the message42001-09-251-17/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-09-24 <NotZed@Ximian.com> * camel-filter-search.c (check_header): If the type is encoded, get the fallback charset from the message content-type. * camel-mime-part-utils.c (check_html_charset): Dont check for charset==null before calling charset_to_iconv. (simple_data_wrapper_construct_from_parser): " * camel-mime-message.c (process_header): Try use content-type charset param as the fallback charset. * camel-charset-map.c (camel_charset_to_iconv): Handle name == NULL, return NULL. * camel-folder-summary.c (camel_folder_summary_format_address): (camel_folder_summary_format_string): Made private again, removed #warning about it. Renamed to s/camel_folder//. (summary_format_string): Take default charset param. (camel_message_info_new_from_header, message_info_new): Decode content-type field to get the charset parameter to use as the default charset for decoding strings. * camel-search-private.c (camel_search_header_match): Pass NULL as the charset, the locale charset is always tried. (camel_search_header_match): Supply a default_charset parameter to be used with TYPE_ENCODED params. * camel-mime-utils.c (header_param): get rid of the g_strcasecmp crap. (header_set_param): Same here. (header_decode_param_list): And here. (header_decode_text): Totally rewritten. 30% of its size. If the word is not rfc2047 encoded, always try default_charset if supplied, if that fails, try locale charset if it exists, if that fails then assume latin1/7 bit ascii. (append_8bit): Changed to return FALSE if we can't convert for whatever reason, and dont append anything. * camel-mime-part.h (struct _CamelMimePart): Move content_type and headers out of the 'private' section. * camel-mime-part.c (get_headers): Dont do any conversion on the header. (process_header): Get the content-type charset as the fallback charset for decode_string. (construct_from_parser): IF we have a content-type header, process it before doing anything else, so we have access to a fallback charset for invalid headers. svn path=/trunk/; revision=13096
* New function to just load the summary. Not much use yet, until unreadMichael Zucci2001-09-211-0/+30
| | | | | | | | | | | | | | | | | | | | | * camel-folder-summary.c (camel_folder_summary_header_load): New function to just load the summary. Not much use yet, until unread counts are stored in the summary (which now looks like too much work!). * camel-mime-utils.c (header_decode_mailbox): Crappy fix for stupid mailers. If we get 'name b. name <foo>' then treat it as '"name b. name" <foo>'. See 8147. (header_decode_mailbox): Another fix for really broken mailers that have things that look like addresses followed by <address> bits. (rfc2047_encode_word): Escape ??= to avoid some bizarre warning about trigraphs. (scan_dir): If we dont have the folder open, then scan the 'new' and 'cur' folders for new and unread messages to count instead. svn path=/trunk/; revision=13040
* Convert to the iconv-friendly charset names.Jeffrey Stedfast2001-07-201-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-19 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-charset.c (camel_mime_filter_charset_new_convert): Convert to the iconv-friendly charset names. * providers/imap/camel-imap-store.c (create_folder): Fixed a compiler warning about returning without a value in a non-void function. Blah. * camel-mime-part.c (process_header): Pass the locale charset as the default_charset to header_decode_string(). * camel-folder-summary.c (camel_folder_summary_format_string): Pass the locale charset as the default_charset to header_decode_string(). (content_info_new): Same. * camel-mime-message.c (process_header): Pass the locale charset as the default_charset to header_decode_string(). * camel-mime-utils.c (append_8bit): New helper function who's purpose is similar to append_latin1() but for 8bit text that we are assuming is not latin1. (header_decode_text): Now takes a default_charset parameter and calls append_8bit when appropriate. (header_decode_string): Also takes a default_charset parameter now. (header_decode_mailbox): Pass NULL as the default_charset to header_decode_string(). svn path=/trunk/; revision=11250
* Removed some code i wasn't supposed to commit.Not Zed2001-07-121-5/+0
| | | | | | | | | | | | | | | 2001-07-12 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_info_new_from_message): Removed some code i wasn't supposed to commit. * providers/local/camel-local-summary.c (local_summary_add): Only set info->size if it is not zero. (local_summary_add): If we dont get a size from the info passed in, calculate it using a null stream write. Should do #4392. svn path=/trunk/; revision=11025
* Create the messageinfo itself, so we can properly set the size.Not Zed2001-07-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-11 Not Zed <NotZed@Ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_mbox): Create the messageinfo itself, so we can properly set the size. * camel-movemail.c (camel_movemail_solaris): Write out the from line between each message. 2001-07-10 Not Zed <NotZed@Ximian.com> * providers/local/camel-local-summary.c (local_summary_add): Copy the size across from the source message info if supplied. * camel-stream-null.c: Added a 'written' member which keeps track of how much has been written to the stream. * camel-movemail.c (camel_movemail): If we have BROKEN_SPOOL defined, then use the solaris movemail to quote from lines that sendmail didn't. (camel_movemail_solaris): Compile this in if BROKEN_SPOOL defined. svn path=/trunk/; revision=10989
* Added an assert to make sure that `mi' isn't NULL.Jeffrey Stedfast2001-07-061-7/+12
| | | | | | | | | | | | | | 2001-07-05 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (camel_message_info_string): Added an assert to make sure that `mi' isn't NULL. (camel_message_info_set_string): Same. * providers/imap/camel-imap-command.c (camel_imap_response_free): Create and use a temporary CamelException for use with camel_imap_folder_changed. svn path=/trunk/; revision=10834
* (camel_message_info_dup_to): Assign the to->strings from theMichael Zucci2001-07-051-1/+1
| | | | | | | e_poolv_cpy() call, since it may allocaote a new poolv if the lengths do not match. svn path=/trunk/; revision=10790
* When indexing a new record, create a pseudo word 'ibexindexed' so we canNot Zed2001-07-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | 2001-07-05 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_info_new_from_message): When indexing a new record, create a pseudo word 'ibexindexed' so we can always tell that a message has already been idnexed, even if it contains no words of its own. Things like maildir use this check to see if its already been processed, and it matters if it is incorrect in this case (not just wasted cycles). (camel_folder_summary_info_new_from_parser): And same here. * providers/local/camel-maildir-summary.c (maildir_summary_sync): Changed the logicfor epoolv code to be different, we dont need to update hash references or any tricky stuff. (maildir_summary_check): Samehere. * camel-folder-summary.h: Removed include of e-memory.h. svn path=/trunk/; revision=10785
* re-enable html indexing.Not Zed2001-07-021-4/+2
| | | | | | | | | | | | 2001-07-02 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (summary_build_content_info): re-enable html indexing. * camel-mime-filter-html.c: Completely re-implemented using a custom parser. svn path=/trunk/; revision=10676
* Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-231-2/+2
| | | | | | helixcode.com with ximian.com all over the place. svn path=/trunk/; revision=10440
* Only create a missing uid if we have indexing turned on.Not Zed2001-06-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-06-18 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_info_new_from_parser): Only create a missing uid if we have indexing turned on. * camel-lock-helper.c (setup_process): Function to setup process/sanity/security checks. Change to the real uid as soon as we can. (lock_path): First try to lock as the real uid, if that fails, try the root uid. (unlock_id): Unlock as the uid we created the lock as. * Makefile.am (INCLUDES): Added -DCAMEL_SBINDIR for lock helper location. * providers/local/camel-spool-folder.c (spool_lock): Implemented, using lock helper locking. Need to work out if the locking requires a root created lock? (spool_unlock): Likewise. 2001-06-15 Not Zed <NotZed@Ximian.com> * camel-lock-helper.c: Setuid Lock helper process. Creates and manages .locks, keeping them active, removing them, etc. What real perms it needs is a little system dependent. 2001-06-14 Not Zed <NotZed@Ximian.com> * providers/local/camel-maildir-store.c (get_folder_info): Implement. (scan_dir): Does the work of scanning for maildir directories. 2001-06-13 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-store.c (get_folder_info): Implemented, just returns a hardcoded INBOX folder. (free_folder_info): implemented, free's the 1 possible level of folder info. * providers/local/camel-spool-folder.c (camel_spool_folder_construct): Set the real unread message count on the folder_created thing. svn path=/trunk/; revision=10261
* New file, with the int, string, time_t, and off_t encode/decode routinesDan Winship2001-04-271-331/+64
| | | | | | | | | | | | | | | | | | | | | | | | | * camel-file-utils.c: New file, with the int, string, time_t, and off_t encode/decode routines from camel-folder-summary.c moved here and renamed, for the enjoyment of non-CamelFolderSummary subclasses. * Makefile.am (libcamel_la_SOURCES): Add camel-file-utils.c (libcamelinclude_HEADERS): and camel-file-utils.h * camel-folder-summary.c: Remove functions that were moved to camel-file-utils.c, update uses of them for the new names. (camel_folder_summary_{en,de}code_token are still here.) * providers/local/camel-mbox-summary.c: Use camel_file_util_* names * providers/imap/camel-imap-summary.c: Use camel_file_util_* names * providers/imap/camel-imap-store.c (imap_store_setup_online, imap_store_setup_offline): Use camel_file_util_* names, which makes much more sense since this isn't folder summary stuff. svn path=/trunk/; revision=9590
* Applied jacob's patches for e-poolv stuff.Not Zed2001-04-261-49/+82
| | | | | | | | 2001-04-26 Not Zed <NotZed@Ximian.com> * Applied jacob's patches for e-poolv stuff. svn path=/trunk/; revision=9571
* merge from evolution-0-10-branch to evolution-0-10-merge-0Not Zed2001-04-051-0/+4
| | | | | | | | 2001-04-05 Not Zed <NotZed@Ximian.com> * merge from evolution-0-10-branch to evolution-0-10-merge-0 svn path=/trunk/; revision=9194
* Unref the html filter when done. (summary_build_content_info): DisableNot Zed2001-03-271-5/+11
| | | | | | | | | | | 2001-03-27 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_finalize): Unref the html filter when done. (summary_build_content_info): Disable using the html parser to help index html mails until it gets sorted out. svn path=/trunk/; revision=8975
* Added folder_created event here.Not Zed2001-03-271-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-27 Not Zed <NotZed@Ximian.com> * camel-vee-store.c (vee_get_folder): Added folder_created event here. * camel-vee-folder.c (unmatched_finalise): Removed, moved into main finalise code. (message_changed): Just create a new change entry and promote it to a folder_changed thing. (vee_sync): Always rebuild folder on sync, even when not expunge. (folder_changed): If not autoupdating, make sure we remove any removed entries. (vee_folder_build_folder): (vee_folder_remove_folder): NOP if we're called on folder_unmatched. (vee_search_by_expression): Only search each folder once. Should we also order the result in summary order? 2001-03-20 Not Zed <NotZed@Ximian.com> * camel-store.c (init_trash): Fix calling for vee_folder_new(). * camel-folder-summary.c (camel_folder_summary_remove_index): Optimise slightly, use ptr_array_remove_index rather than have to search for the index by using summary_remove. * camel-vee-folder.h: Removed local member from VeeFolder, since it was never used. * camel-vee-store.c (camel_vee_store_finalise): Setup finalise function. * camel-vee-folder.c (camel_vee_folder_set_expression): New function to set the query of an existing vfolder. (camel_vee_folder_construct): New function for convenience/subclasses. (camel_vee_folder_new): Removed exception parameter, no longer needed (since we dont search yet). (camel_vee_folder_new): Changed to use folder_construct, and no longer raise the folder created signal. (vee_folder_build_folder): Make it return error on exception, so we can work without exceptions. (vee_folder_remove_folder): Use remove index rather than remove_uid, this is ok since we have the summary locked for our own access. (camel_vee_folder_add_folder): Only add the folder to the unmatched private if it is not a private folder. (camel_vee_folder_remove_folder): Only remove the folder from unmatched if it is not private. (vee_expunge): Just call sync with expunge set. (vee_sync): If expunging, also refresh the search. (vee_folder_build_folder): We do our own locking now, removed from callers, also trigger changed events here too (within locks), fixed callers appropriately. (vee_folder_remove_folder): Do our own locking, and trigger changed events. (vee_folder_add_info): Renamed of vee_folder_add, we now take a hash of the folder name, rather than use the folders address. (hash_folder): Convert a folder name into an 8 character hash. (vee_get_message, vee_search_by_expression, vee_set_message_flags, vee_set_message_user_flag, vee_move_message_to): Changed the uid to be an 8 byte hash + original uid, with no ':' anymore. svn path=/trunk/; revision=8957
* re-constify inbuf, to remove a warning.Not Zed2001-03-141-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-14 Not Zed <NotZed@Ximian.com> * camel-mime-filter-charset.c (filter, complete): re-constify inbuf, to remove a warning. * camel-mime-parser.c (folder_scan_step): When we're out of data, run the filter_complete. For some reason the logic that was there was never being run, always try it now, i think it was to work around a buggy filter, rather than fix it the right way. * camel-folder-summary.c (summary_build_content_info): If indexing html parts, use the html filter to convert it to some indexable format. (summary_build_content_info): Reset the filters before adding them back to the stream, if they get re-used in a given instance (likely). * Makefile.am (libcamelinclude_HEADERS): Added camel-mime-filter-html.[ch]. (INCLUDES): Added xml clags 2001-03-05 Not Zed <NotZed@Ximian.com> * camel-folder-search.c (camel_folder_search_class_init): Setup a new function, "uid" which matches uids. (search_uid): Implement the "match uid" command. svn path=/trunk/; revision=8705
* Doh, cut and paste problem, use mlist not cc.Michael Zucci2001-02-231-1/+1
| | | | | | | | | | | * camel-folder-summary.c (camel_message_info_new_from_header): Doh, cut and paste problem, use mlist not cc. * camel-folder.c (move_message_to): (copy_message_to): If the source folder doesn't support a summary, dont try and get the message info from it. svn path=/trunk/; revision=8361
* Take the ^Header: part out of the expression, since we look that upNot Zed2001-02-201-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | 2001-02-20 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (mail_list_magic): Take the ^Header: part out of the expression, since we look that up ourselves. (header_raw_check_mailing_list): When getting the match, get match 1, not match 0, we dont want the full string match. * camel-folder-summary.c (CAMEL_FOLDER_SUMMARY_VERSION): Bumped for summary change. (message_info_new): Extract the mlist info from the headers. (message_info_load): Load mlist from summary. (message_info_save): Save mlist to summary. (message_info_free): Save the mlist entry. (camel_message_info_new_from_header): Extract mailing list header. (camel_message_info_dup_to): Copy the mlist entry. (camel_message_info_free): Free mlist. (message_info_dump): Dump the mlist. * camel-folder-summary.h: Add an mlist (mailing list) string to the summary. svn path=/trunk/; revision=8295
* Removed some debug 'warnings', as they should now be displayed at theNot Zed2001-01-231-16/+55
| | | | | | | | | | | | | | | | | | | | | 2001-01-23 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-summary.c (message_info_load): Removed some debug 'warnings', as they should now be displayed at the toplevel loader, and just made the code match similar code elsewhere. * providers/local/camel-mbox-summary.c (message_info_load): Error handling. (message_info_save): more error handling. * camel-folder-summary.c (message_info_load): Add error handling and sanity checking. (camel_folder_summary_load): Add error checks. (perform_content_info_load): Error + sanity checks. (content_info_load): error + sanity checks. svn path=/trunk/; revision=7737
* Add some g_warnings() to help debug later if I ever get the segfaults IJeffrey Stedfast2001-01-181-3/+0
| | | | | | | | | | | | | | | 2001-01-17 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-summary.c (message_info_load): Add some g_warnings() to help debug later if I ever get the segfaults I was getting earlier. Can't seem to reproduce them after my previous "fix". * camel-folder-summary.c (camel_folder_summary_load): Undid my change here, NotZed said it was wrong and that if it gets a NULL mi then it should abort and not continue. svn path=/trunk/; revision=7609
* Make sure that the message-info is non-null before we go accessing innerJeffrey Stedfast2001-01-181-1/+4
| | | | | | | | | | | | 2001-01-17 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (camel_folder_summary_load): Make sure that the message-info is non-null before we go accessing inner parts of it and/or adding it to the summary array. I may not have handled the error correctly, but it does seem to work correctly. If NotZed could double-check this it'd be great. svn path=/trunk/; revision=7608
* Add an int i so this code will compile. Should I be worried about how wellJeffrey Stedfast2001-01-171-1/+2
| | | | | | | | | | 2001-01-16 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (camel_folder_summary_array): Add an int i so this code will compile. Should I be worried about how well this code will work? ;-) svn path=/trunk/; revision=7562
* Index: ChangeLogMichael Zucci2001-01-171-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evolution/camel/ChangeLog,v retrieving revision 1.684 diff -r1.684 ChangeLog 0a1,34 > 2001-01-17 Not Zed <NotZed@Ximian.com> > > * camel-folder.c (free_summary): Call > camel_folder_summary_array_free() to do the work. > (get_summary): Use camel_folder_summary_array() to get the array > atomically. These fixes allow folder/test8 to work again, and fix > a sort of race where the summary size can change while we were > making a copy of it. > > * camel-folder-summary.c (camel_folder_summary_array): Get the > summary array atomically, so it can't contain empty records. > (camel_folder_summary_array_free): And free it. > > * tests/lib/camel-test.c (die): If we are verbose & in threads, > then goto sleep so we can debug. > > * tests/folder/test8.c (worker): Add a missing pull() for > comnparing content. > > * camel-filter-search.c: Fix the symbol table, so match-all is an > immediate function, as it should be. > > * tests/folder/test9.c (main): New test, tests some filtering > things. > > * tests/message/test3.c (main): Dont use a boundary string with > spaces in it. Folding can corrupt it. Maybe the folding isn't > working entirely right, but anyway. > > * camel-session.c: Debug out the debug. > > * camel-filter-driver.c (camel_filter_driver_filter_folder): Plug > a messageinfo leak. > 1a36,94 > > * camel-filter-search.c (header_exists): Changed to support > multiple args (or'd together). > (header_contains): Cleaned up to match the search code. Why did > fejj change it? I'll never know. > (header_matches): > (header_starts_with): > (header_ends_with): Big cleanup of fejj's "i'm the cut & paste > king" code. Also properly handle or'ing of additional args to > match what the folder-search code should do. > (check_match): New function which does the annoying matching > stuff (for header matches). > (check_header): Similarly, handles or'ing of the matches together. > (header_contains): > (header_matches): > (header_starts_with): > (header_ends_with): Call check_header to do the actual work. > (header_soundex): And here too. > (match_all): Yeah like match-all isn't passed expression results, > its passed expression terms. Fix this so match-all works like it > should, by executing the contained expression. > (message_body_contains): Copied directly from > camel-folder-search.c, a more robust/faster/simpler body search > code. > (mime_part_matches): Removed entirely. > (handle_multipart): Removed entirely. > (build_match_regex): Copied from camel-folder-search. Builds a > set of simple strings into a regex pattern that matches any of > them (for faster & simpler matching). Expanded to accept regex > patterns itself, so it can merge them together. > (body_contains): Use build match/match message to match using a > built regex. > (body_regex): Likewise, this time we tell it we're building a > regex though. > (header_full_regex): Use build_match_regex to take the drudgery > out of it, and expand it to handle multiple regex's at once. > (get_full_header): slightly cleaner (well i dunno, the sprintf > stuff just got to me). > (header_regex): Cleaned up to use build_match_Regex too, and to > properly check types. > (filter_message_search): Just allocate 'fms' on the stack. > > * camel-filter-driver.c (camel_filter_driver_finalise): > (camel_filter_driver_init): > (camel_filter_driver_class_init): > (camel_filter_driver_get_type): Changed from gtk object to camel > object. > (camel_filter_driver_add_rule): New function to add a rule to be > processed in sexp form. > (camel_filter_driver_init): Init the rules list. > (camel_filter_driver_finalise): Clear the rules/rules list. > (camel_filter_driver_filter_message): Scan rules list directly > rather than creating on the fly. > > * Makefile.am (libcamelinclude_HEADERS): Added camel-filter-driver.h > (libcamel_la_SOURCES): Added camel-filter-driver.c, code taken > from filter-driver, which can drive, uh, filters based on sexp's. > (libcamelinclude_HEADERS): > (libcamel_la_SOURCES): Added camel-filter-search.[ch] svn path=/trunk/; revision=7560
* Delayed loading of IMAP message parts.Dan Winship2001-01-171-17/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-types.h: typedef CamelMessageInfo and CamelMessageContentInfo here * camel-folder-summary.h: Add a "size" field to CamelMessageContentInfo. * camel-folder-summary.c (camel_folder_summary_content_info_new, camel_folder_summary_content_info_free): Renamed and made non-static for providers that construct their own content info. (content_info_load, content_info_save): load/save size * camel-data-wrapper.c (camel_data_wrapper_is_offline): New function to return if a data wrapper's contents are "offline". (So that, for example, we don't make thumbnails of images that haven't been loaded off the IMAP server yet.) Defaults to FALSE. * providers/imap/camel-imap-folder.c (camel_imap_folder_selected): Fix a bug in re-selecting a folder when messages have been expunged from it by another client in the meantime. (imap_get_message): Rewrite. If the message is larger than a certain size, just create a skeleton message containing CamelImapWrappers that will read parts as needed. This way, large attachments only need to be downloaded if the user looks at them, and multipart/alternative alternatives that aren't used will never be downloaded at all. (imap_update_summary): Rewrite this a bunch too to make the parsing more robust. * providers/imap/camel-imap-summary.c (CAMEL_IMAP_SUMMARY_VERSION): bump. (camel_imap_summary_new): Set build_content to TRUE. (content_info_load, content_info_save): Only save/load the content for messages that have it. (The content info gets created as a side effect of imap_get_message.) * providers/imap/camel-imap-utils.c (imap_parse_body): New routine (and helpers) to parse an IMAP 'body' FETCH response and fill in a CamelMessageContentInfo from it. * providers/imap/Makefile.am (libcamelimap_la_SOURCES, libcamelimap_la_HEADERS): add camel-imap-wrapper. svn path=/trunk/; revision=7557
* Chganged len back to be unsigned. And do a simple range check on theNot Zed2001-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-16 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_decode_string): Chganged len back to be unsigned. And do a simple range check on the string value to try and detect corrupted summary files. * providers/imap/camel-imap-command.c (imap_read_untagged): Handle cancelled stream reads with an appropriate exception. * providers/imap/camel-imap-private.h: Fix the include-once macro. Doh, confliced with camel-private.h. * providers/imap/camel-imap-store.c (imap_store_refresh_folders): A copy of camel_remote_store_refresh_folders. We avoid locking each folder when we call it though. This should be removed when i can work out how to remove the folder lock from this function easily. * camel-stream-fs.c (stream_write): Fix n' argument of select. (stream_read): Likewise. * camel-remote-store.c (socket_connect): Bump the connect timeout upto 4 minutes. (socket_connect): Oops, fix the 'n' argument of select. * camel-session.c (camel_cancel_cancel): If we are given no cancellation node, then do it for all active ones. svn path=/trunk/; revision=7526
* Remove this. It was only a thin wrapper around struct _header_content_typeDan Winship2000-12-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * gmime-content-field.[ch]: Remove this. It was only a thin wrapper around struct _header_content_type anyway, and didn't match the naming scheme of anything else. * Makefile.am: Remove gmime-content-field.[ch] * camel.h: Remove gmime-content-field.h * camel-types.h: Add CamelContentType as a typedef for struct _header_content_type (especially for use outside of camel). * camel-multipart.c: * camel-mime-part.c: * camel-mime-message.c: * camel-folder-summary.c: * camel-folder-search.c: * camel-data-wrapper.[ch]: Use CamelContentType and header_content_type_* functions rather than the GMime stuff. * camel-mime-part-utils.c: * camel-medium.c: Remove unused gmime-content-field.h include. svn path=/trunk/; revision=7186
* Lock the command channel while searching. (imap_body_contains): IfNot Zed2000-12-241-46/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-12-24 Not Zed <NotZed@HelixCode.com> * providers/imap/camel-imap-search.c (imap_body_contains): Lock the command channel while searching. (imap_body_contains): If performing a whole uid search, then add references to our own summary items, dont look it up in the folder. This way they can't vanish unexpectedly. * providers/imap/camel-imap-folder.h (CamelImapFolder): Added a private field. * providers/imap/camel-imap-private.h: Added lock for imap searches. * Merge from camel-mt-branch. * providers/imap/camel-imap-folder.c (imap_update_summary): Merge fix, use the folder->summary. (imap_get_message_flags, imap_set_message_flags, imap_get_message_user_flag, imap_set_message_user_flag): Removed again. (camel_imap_folder_init): Setup private data/lock. (imap_finalize): Free private data/search lock. (imap_search_free): Lock the search_lock. (imap_search_by_expression): Lock the search lock when using the search object. Also copy/ref hte summary, rather than getting it directly. (imap_refresh_info): Free any info lookups. Use folder->summary not imap_folder->summary. And lock around commands. svn path=/trunk/; revision=7150
* Added #ifndef NO_WARNINGS around a #warning. Added (void) to the prototypeChristopher James Lahey2000-12-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-12-12 Christopher James Lahey <clahey@helixcode.com> * camel-folder-summary.c, camel-folder-summary.h: Added #ifndef NO_WARNINGS around a #warning. Added (void) to the prototype and declaration of camel_message_info_new. * camel-mime-message.h: Added an include for camel-mime-filter-bestenc.h. Added a prototype for camel_mime_message_set_best_encoding. Reformatted prototypes to line up. * camel-mime-parser.c: Added #if d(!)0 around the states string lookup table since it's only used in debugging output. * camel-seekable-substream.c (stream_flush): Added a cast. * providers/imap/camel-imap-auth.c: Added #include <netinet/in.h>. * providers/imap/camel-imap-folder.c (imap_refresh_info): Made uid and flags const to fix warnings here. * providers/imap/camel-imap-store.c (get_folder_info): Made p const to fix warnings here. svn path=/trunk/; revision=6954
* Fix the check for "flags aren't actually changing".Dan Winship2000-12-061-5/+16
| | | | | | | | | | | | | | | * providers/imap/camel-imap-folder.c (imap_set_message_flags): Fix the check for "flags aren't actually changing". * providers/local/camel-local-folder.c (local_set_message_flags, local_set_message_user_flag, local_set_message_user_tag): Don't emit message_changed unless the flags actually changed. * providers/nntp/camel-nntp-folder.c (nntp_folder_set_message_flags): Don't emit message_changed unless the flags actually changed. Fix the check for marked as seen. svn path=/trunk/; revision=6797
* Added system_flag to CamelFolderSearchClassJeffrey Stedfast2000-12-021-0/+50
| | | | | | | | | | | | | | | | 2000-12-01 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-search.h: Added system_flag to CamelFolderSearchClass * camel-folder-summary.c (camel_system_flag_get): Convenience function to return whether or not a flag is set using a string as the flag name. (camel_system_flag): Return the integer value of the flag string. * camel-folder-search.c (search_system_flag): New ESExp callback for allowing vfoldering on CamelMessageInfo flags. svn path=/trunk/; revision=6763
* New convenience function, doesn't do much but it sure makes code cleanerJeffrey Stedfast2000-12-011-0/+54
| | | | | | | | | | 2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-summary.c (camel_message_info_new): New convenience function, doesn't do much but it sure makes code cleaner to read. (camel_message_info_new_from_header): This one makes my life heaven. svn path=/trunk/; revision=6749
* Remove assertion that content is there, when it no longer can be.Not Zed2000-11-301-112/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-30 Not Zed <NotZed@HelixCode.com> * providers/local/camel-mbox-folder.c (mbox_get_message): Remove assertion that content is there, when it no longer can be. * camel-folder-summary.h: Removed pos/bodypos/endpos from camelmeessagecontentinfo. (CamelMessageFlags): Added an attachments flag. * providers/local/camel-local-summary.h: Added load virtual function. * tests/lib/folders.c (test_message_info): Accessors. (test_folder_message): " * camel-folder-thread.c (get_root_subject): Fix accessors. (dump_tree_rec): " * camel-folder-search.c (camel_folder_search_execute_expression): Accessors for messageinfo. (search_match_all): " (search_header_contains): " (search_header_contains): " (search_body_contains): " (camel_folder_search_execute_expression): Use mepool_strdup. * providers/local/camel-mbox-summary.c (summary_update): Accessors for messageinfo. (mbox_summary_sync_full): " * providers/local/camel-mh-summary.c (remove_summary): Accessors for messageinfo. (mh_summary_check): " (mh_summary_sync_message): " (mh_summary_sync): " * providers/local/camel-mh-folder.c (mh_append_message): Use accessor for uid. * providers/local/camel-local-summary.c (local_summary_decode_x_evolution): Use accessor to uid. (local_summary_encode_x_evolution): Likewise. (message_info_new): And here. (camel_local_summary_load): Call virtual load function. (local_summary_load): Default load function, load summary. (camel_local_summary_load): Check file exists before trying to load. (camel_local_summary_construct): Turn off building content info! (CAMEL_LOCAL_SUMMARY_VERSION): Bump, since we dont build content info anymore. (camel_local_summary_load): After a successful load/check, do a save too so we dont have to go through it again randomly. * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Use accessors for messageinfo. * providers/nntp/camel-nntp-folder.c (nntp_folder_get_uids): Use accessors for uid. * providers/imap/camel-imap-folder.c (imap_refresh_info): Use accessor for uid. (imap_sync): Likewise. (imap_get_uids): Likewise. (imap_update_summary): And here. * providers/vee/camel-vee-folder.c (vfolder_remove_match): Use accessor for uid. (vfolder_add_match): Handle estrv stuff. (vfolder_change_match): Accessor for uid. (get_real_message): " (vee_get_uids): " (vee_folder_build): " + estrv. (vee_folder_build_folder): " * providers/local/camel-maildir-folder.c (maildir_append_message): Use acccessors for uid's. (maildir_get_message): Here too. * providers/local/camel-maildir-summary.c (camel_maildir_summary_init): Setup the string count for us. (message_info_new): Access the string array directly. (message_info_free): No need to free string if using array. (camel_maildir_summary_info_to_name): Use accessor to get to uid. (remove_summary): And here. (maildir_summary_check): Likewise. (maildir_summary_sync): And here. (maildir_summary_load): Load up a cache of uid->filename mappings before loading the actual summary file. This saves us having to waste the diskspace storing the filenames in the summary itself, and also helps us sync the summary better on load. (message_info_load): If we have the load_map setup, and the uid exists, then set the filename cache from it, and update the flags from the name, incase our summary mismatches it. * camel-folder-summary.c (camel_folder_summary_init): Setup string count for compressed info record. An optional compile mode which stores all strings for a given messageinfo into a packed array, which should save 36-50 bytes/record. (camel_folder_summary_info_new): Init the string array. (message_info_new): Set the string array items, as required. (message_info_load): And here too. (message_info_save): Use accessors to get to strings. (message_info_free): Free strings as one. (camel_message_info_dup_to): Handle packed array case. (camel_folder_summary_add): Use accessors. And pack the strv before storing it. (summary_assign_uid): New function to assign a unique uid to a message, if it doesn't have one. (camel_folder_summary_add): Call assign_uid instead of doing it ourselves. (camel_folder_summary_info_new_from_parser): " (camel_folder_summary_info_new_from_message): " (camel_folder_summary_encode_string): constify. (camel_folder_summary_encode_token): " (summary_build_content_info_message): Fix accessors to messageinfo. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped, for removal of contentinfo->pos data. (camel_folder_summary_info_new_from_parser): Calculate the size based on the parser position, not the removed contentinfo stuff. (camel_folder_summary_info_new_from_message): Remove size stuff. (camel_folder_summary_offset_content): Removed, no longer means anything. (content_info_new): (content_info_load): (content_info_save): (summary_build_content_info): Remove stuff for contentinfo->pos*. (summary_build_content_info): Take a msginfo argument, set attachments flag if we find any attachments. (summary_build_content_info_message): set attachments flag if we find any attachments. (camel_folder_summary_info_new_from_parser): Always scan the content info, even if we dont save it. (camel_folder_summary_info_new_from_message): And here too. (summary_build_content_info): Only create the contentinfo stuff if we have it turned on, otherwise just parse and discard. (summary_build_content_info_message): Likewise. svn path=/trunk/; revision=6731
* Fixes for the summary messageid changes. Hash the messageid and store it.Not Zed2000-11-211-33/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-20 Not Zed <NotZed@HelixCode.com> * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Fixes for the summary messageid changes. Hash the messageid and store it. (get_XOVER_headers): Use camel_folder_summary_info_new() to create the summary item before adding it. * camel-folder-summary.h (CamelMessageInfo): Changed the messgae-id to be an 8 byte md5 hash, and the references list to be an array of these. * providers/local/camel-mh-summary.c (mh_summary_sync_message): New function, sync out the message info stuff. Only updates the X-Ev header if it can get away with it, otherwise writes out a whole new message. (mh_summary_sync): Added more functionality. All summary info is now written to the X-Ev header, etc, and new messages re-written if required during the sync process. * providers/local/camel-local-folder.c (local_set_message_user_flag): Set the XEVCHANGE flag. (local_set_message_user_tag): And here too. * providers/local/camel-local-summary.h: New flag CAMEL_MESSAGE_FOLDER_XEVCHANGE to indicate the XEV header has probably changed size and needs to be rewritten in whole. * camel-folder-summary.c (next_uid_string): Want this static, not const. (message_info_new): Store the references and message-id values as 64 bit, binary hashes. (message_info_load): fix for message-id/references changes. (message_info_save): Likewise. (camel_message_info_dup_to): And here. (camel_message_info_free): And here too. No longer free message_id, and simple free for references array. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped file revision. (camel_folder_summary_init): Init memchunk allocators to empty. (camel_folder_summary_finalize): Free memchunk allocators if there. (message_info_new): Use the chunk allocator to allocate message info's. (camel_folder_summary_info_new): New helper to allocate the message info, and setup the memchunk if required. (content_info_alloc): Likewise for content info's. (message_info_load): Use summary_info_new_empty. (content_info_new): Use content_info_alloc. (content_info_load): " (content_info_free): Free the content info as a memchunk. (message_info_free): Free everything directly and the base as a memchunk, rather than calling camel_message_info_free(), which assumes a malloc'd array. * providers/local/camel-local-summary.c: Include ctype.h, kill a warning. (local_summary_decode_x_evolution): If we get a NULL message info, then dont try and set anything, just check for validity. (camel_local_summary_write_headers): New function to write a set of headers to an fd. (camel_local_summary_check): Added some statistic generation stuff for memory profiling. * providers/local/camel-mbox-summary.c (header_write): Changed to use stdoi functions to write out the header to a buffered stream, instead of using writev, which is apparently slow (and writing each line separately is slow anyway). (mbox_summary_sync_full): New implementation. Does things differently, doesn't use or require the content info stuff. (summary_rebuild): Dont return an error if we start scanning at the end of file. (mbox_summary_sync_full): If we are not writing out new headers, make sure we copy the From line as we go, and update frompos appropriately. (mbox_summary_sync_full): Always copy the From line from the existing one, rather than trying to make one up ourselves. (mbox_summary_sync): If we can get by with a quick-sync, then try it, if that fails, then try a full sync anyway. (mbox_summary_sync_quick): Quick sync. Only update system flags, etc. (mbox_summary_sync_full): Use the proper local summary encode_xev function. (header_evolution_decode): Removed, no longer needed. (header_evolution_encode): Same. (copy_block): No longer needed, removed. (header_write): Removed, replaced with camel_local_summary_write_headers. (mbox_summary_sync_full): Fixed for header_write change. * camel-mime-parser.c (folder_scan_step): Implement the new optional parser state HSCAN_PRE_FROM, that returns the (currently unfiltered) input data. (folder_scan_drop_step): Do the right thing for the PRE_FROM state. (camel_mime_parser_scan_from): Update the doco. (camel_mime_parser_scan_pre_from): Ok, make this behaviour optional, it simplifies a lot of loops that dont otherwise need to know about it. (folder_scan_step): Made the PRE_FROM state optional. (struct _header_scan_state): Made the bool vars 1 bit. (folder_pull_part): Free the from_line buffer if it is there. (folder_scan_skip_line): Added a new arg, can save the skpped data to a byte_array, as we go. (folder_scan_step): Fixed calls to skip_line approrpiately. Now we save the from line as we parse it. (camel_mime_parser_read): New function to read from the mime parser buffer directly. Useful if you use the parser to read the first/some headers, then need to scan the rest of the data, without needing to use a seek(), or allocate your own buffers. * camel-mime-parser.h (struct _header_state): Added a new parser state, pre-from which returns any data found before a from line during parsing (all other data can be retrieved by the caller except this). svn path=/trunk/; revision=6618
* Removed local again, not quite ready.Not Zed2000-11-151-45/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-15 Not Zed <NotZed@HelixCode.com> * providers/Makefile.am: Removed local again, not quite ready. 2000-11-14 Not Zed <NotZed@HelixCode.com> * camel-folder-summary.c (message_info_new_from_message): Use message_info_new to create the summary from headers, instead of getting directly from the message. (format_recipients): No longer required. * providers/Makefile.am (SUBDIRS): Added local. 2000-11-11 Not Zed <NotZed@HelixCode.com> * camel-mime-parser.c (folder_push_part): Make sure 'atleast' is at least 1, always. This is possibly a temporary fix for a bad failure mode on bad multipart messages. (folder_scan_content): Go until inend, not inend+1. Changed the continuation and retry logic to be simpler and more robust. If we can't find a marker within the atleast we need, just set it to 1, and try again, rather than just going to the next smaller limit (boundary check checks the length anyway). (header_append): streamline the empty line case. And strip trailing \r's if there are any (\n's already stripped). (folder_scan_header): Reordered and cleaned up a lot. Check for continuation only once, and compress lwsp then. Assume the header buffer already has end of line's stripped, and simplify some things: Only check for end of headers once and easier. Dont check to remove end of line character Dont bother testing inptr-start if we get a boundary match - it is always zero. (folder_scan_header): Removed the unused part variable, and a few pointless assignments. (folder_scan_header): Change the end limit to be 1 higher, to make sure we get all content. (folder_scan_content): And here too. (folder_scan_header): Killed a warning. (folder_push_part): Removed a bad comment. Actually boundarylenfinal can be zero for a new message not in a multipart. So we fix that here. 2000-11-09 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_decode_param_list): Renamed from header_param_list_decode. (header_param_list_decode): New external function to decode a parameter list. (header_param_list_format_append): Made public. (header_param_list_format): Another new public helper function for formatting just a param list. * camel-folder-summary.c (next_uid_string): Default implementation is the same as before. (camel_folder_summary_class_init): And set it up. * camel-folder-summary.h: Make next_uid_string a virtual function. * camel-folder.c (camel_folder_change_info_changed): New function to return true if the changeset contains any changes. svn path=/trunk/; revision=6577
* Implement a complete() function, now we need one. (filter): Upgraded toNot Zed2000-11-071-46/+651
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-07 Not Zed <NotZed@HelixCode.com> * camel-mime-filter-bestenc.c (complete): Implement a complete() function, now we need one. (filter): Upgraded to match rfrc2045 properly. Checks also for length of line and valid CRLF sequences. (camel_mime_filter_bestenc_get_best_encoding): Do the work of working out what is the best encoding given what we found about the stream. * camel-mime-part.c (camel_mime_part_encoding_to_string): Use a lookup table to get the encoding naem, and add the binary type. (camel_mime_part_encoding_from_string): Likewise for the reverse. * camel-mime-part.h: Added the binary encoding type, see rfc2045. * camel-mime-utils.c (header_param_list_format_append): Dont put a space before ;'s in parameter lists, makes them more readable/consistent. * camel-mime-message.c (multipart_has_8bit_parts): Cleaned up the old stuff, well removed it. (camel_mime_message_set_best_encoding): Added another argument that lets you select what you want to set the best of. i.e. for smtp transport we only need 7 bit, and dont need to optimise the charset (although of course, we should always). (find_best_encoding): Implement this feature, if we are not getting the best charset, use the one we have. (best_encoding): Set the charset on the part appropriately. Sigh, the interfaces for this are nonexistant. (find_best_encoding): Tell the bestenc filter that lf should be treated as crlf for the purposes of determining encodings. 2000-11-06 Not Zed <NotZed@HelixCode.com> * camel-charset-map.c (camel_charset_init): Init function for an iterative charset determinator. (camel_charset_step): Iterate another buffer. (camel_charset_mask): Removed, since it couldn't have worked. (camel_charset_best): Use the iterative interface to do the work. (camel_charset_best_name): Get the best name for a charset so far. * camel-mime-filter-bestenc.c: New class, a stream filter that can be used to memory-efficiently determine the best encoding and/or charset to use for a given stream of bytes. * Makefile.am (libcamelinclude_HEADERS): Added stream-null*. (libcamel_la_SOURCES): Added bestenc* * camel-stream-null.c: New class, a null-stream, that always succeeds, and never has any contents. * camel-stream.c: Minor pointless changes. Was going to do something else but changed my mind. Added trivial default implementations for all callbacks. * camel-mime-message.h: Cleaned up some old cruft. * camel-folder-summary.c (camel_folder_summary_format_address): address_list_format() no longer encodes, so we dont need to decode it. * camel-address.c (camel_address_unformat): New function, attempts to reverse the formatting process on display addresses. (camel_address_length): New function to get the number of addresses, without having to peek the structure. * camel-mime-message.c (camel_mime_message_set_from): Fix a typo. (camel_mime_message_finalize): Only unref from/reply_to if we have it. (camel_mime_message_set_recipients): New function - set the recipients as a CamelInternetAddress. This function effectively deprecates the older recipient setting functions. (camel_mime_message_add_recipient): What the hell, i'll bite the bullet. Terminate this function. The old api was ambiguious and inefficient and didn't work right anyway. (camel_mime_message_remove_recipient_address): And this one. (camel_mime_message_remove_recipient_name): And this one too. (camel_mime_message_set_recipients): If we set an empty header, then remove it from the header list. Allow a null receipient object to clear a header. (camel_mime_message_set_from): Likewise, if setting an empty from address. (camel_mime_message_encode_8bit_parts): Eeek!! camel_stream_mem_new_with_byte_array owns the byte_array we give it, so make sure we dont free any of it! (camel_mime_message_encode_8bit_parts): Infact, i'll just rewrite the whole lot, its a bit of a mess. Should really rename it and make it a little more useful too, lets see ... (best_encoding): This has a string interface? Oh boy. (camel_mime_message_foreach_part): New experimental function to iterate over all message parts. Might not remain. (camel_mime_message_has_8bit_parts): New implementation using foreach_part. Fixed a couple of problems. (find_best_encoding): New function, that finds the best encoding for a given part (will probably be moved to camel-mime-part), and also the best charset to use if it is a text part. Since one affects the other it is a two pass process, but uses streams and not memory to achieve this. (camel_mime_message_set_best_encoding): Uses the function above to configure an entire message for the best encoding possible given transport constraints. (camel_mime_message_encode_8bit_parts): Reimplemented to use the function above to perform the work. * camel-internet-address.c (camel_internet_address_format_address): Dont put <> around a lone address with no real name. (camel_internet_address_encode_address): Similarly. (internet_decode): Actually return the count of decoded addresses. (internet_unformat): Implement the unformatting routine. 2000-11-05 Not Zed <NotZed@HelixCode.com> * providers/smtp/camel-smtp-transport.c (_send_to): Changed to get the internetaddress directly, rather than having to parse it itself. * camel-address.c (camel_address_format): Added a new function which will format address, suitable for display. (camel_address_cat): Concatentate 1 camel address onto another. It is upto the caller to ensure the addresses are of compatible types. (camel_address_new_clone): New function to create a new address by copying an existing one of the same type. (camel_address_copy): New helper function to copy an address. * camel-mime-message.h (struct _CamelMimeMessage): Removed cached copy of date string. (struct _CamelMimeMessage): Added date_received info. * camel-mime-message.c (camel_mime_message_get_date_string): Removed. Nothing uses it anyway, and it is redundant. (camel_mime_message_finalize): No more date_str. (camel_mime_message_init): No more date_str, initialise date_received* (write_to_stream): Change the check for a date header. (process_header): No longer track the date_str. (camel_mime_message_get_received_date): Removed. totally invalid anyway. (camel_mime_message_get_sent_date): Removed. Redundant. The only 'date' is the sent date, the received date is just made up. (camel_mime_message_get_date): Args changed to be more consistent with utility functions. (camel_mime_message_get_date): Dont set the date when we're asked for it (if its not set by the time its written, it'll be set then). (camel_mime_message_get_date_received): Actually do 'the right thing' here, if we have a received header, use that to determine the received date. And return the data in the same format as get_date. (camel_mime_message_set_from): Changed the api to better match what we should be doing. Pass a camelinternetaddress, etc. (camel_mime_message_set_reply_to): Cahnged similarly to take an internetaddress. (camel_mime_message_get_reply_to): Likewise. (camel_mime_message_finalize): Unref the from/reply_to objects. (format_address): Removed, no longer needed. (process_header): Changed to store the from/reply_to as internetaddress's. (write_to_stream): Set the from header directly to empty, if we dont have one. Maybe we should just abort, and/or create one based on the current user. * camel-mime-utils.c (header_address_list_format): Renamed to header_address_list_encode, which is what it is actually doing. (header_address_list_format_append): Similarly. (encoding_map[]): Removed, no longer used. (header_address_list_encode_append): Take another arg, do we encode the address (for internet), or not (for display - utf8 only). (header_address_list_format): Re-added this function, but now it generates a display version only. Surprise surprise, that is all anythign needs to generate anyway. Sigh. * camel-internet-address.c (camel_internet_address_get): Return false if we get an invalid index only. (camel_internet_address_encode_address): Helper function to encode a single address for mailing. (internet_encode): Use the above function to format it. (camel_internet_address_format_address): Format a single address for display. (internet_format): Implement the display version. (camel_internet_address_class_init): Init the internet_format virtual function. (internet_cat): Implement virtual function to concatenate addresses. * camel-folder-summary.c (camel_folder_summary_info_new_from_header): new function, only build the summary info, dont add it. (camel_folder_summary_info_new_from_parser): Likewise, for new info from parser. (camel_folder_summary_add_from_parser): Cahnged to call function above to build info. (camel_folder_summary_add_from_header): Changed to call function above, to build info. (camel_folder_summary_info_free): New function to free the summary message info. (camel_folder_summary_clear): Changed to clal above to free info. (camel_folder_summary_remove): Likewise. (camel_folder_summary_add): Cleaned up the clashing uid re-assignment logic a little bit. (camel_folder_summary_decode_uint32): Fixed a typo, 01 != -1. (camel_folder_summary_decode_time_t): Return -1 on error. (camel_folder_summary_encode_off_t): New function to encode an off_t type. (camel_folder_summary_decode_off_t): And likewise for the reverse. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped the summary version, since we're now encoding time/off_t's right. (summary_header_save): Use time_t encoder to save the timestamp. (summary_header_load): Likewise for decoding the timestamp. (content_info_load): Decode off_t types directly, now we can. (content_info_save): And likewise for encoding. (camel_folder_summary_add_from_message): New function, create a summary item from an existing message and add it. (camel_folder_summary_info_new_from_message): New function, create a summary item from an existing message. (summary_build_content_info_message): New function to do the dirty work of building the conent info/indexing, from a message source. (format_recipients): Format an internetaddress suitable for the summary. (message_info_new_from_message): Build a new summary item from a mime message. (content_info_new_from_message): Build a new conent info from a mime part. (camel_folder_summary_class_init): Init the new class functions. (message_info_new_from_message): Fixed for message api change. Added documentation to the functions. svn path=/trunk/; revision=6474
* Simple subclass of CamelFolderSummary that also keeps a UIDVALIDITY valueDan Winship2000-10-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-summary.c: Simple subclass of CamelFolderSummary that also keeps a UIDVALIDITY value (and doesn't, for the moment, build content info). * providers/imap/camel-imap-folder.c: (various): Use a CamelImapSummary to store/fetch summary info. (camel_imap_folder_new): Take a path to a file to use for the summary. Set the folder's permanent_flags correctly according to the server response. Read in the summary (checking the UIDVALIDITY) and update it if it's out of date. (imap_refresh_info): Just fetch UIDs and flags. If the UIDs all match, update the flags as needed and be done with it. Otherwise, delete messages that have been expunged from the server and fetch full summary info for any new messages. (imap_sync): Save the summary to disk. (imap_update_summary): Renamed from imap_get_summary_internal. Can now be told to get summary for only a subset of messages. Use camel-mime-utils functions rather than rolling our own header parsing. (imap_get_message_info_internal): Merged into imap_update_summary. (imap_set_message_flags): Don't marked the message FOLDER_FLAGGED if we're not actually changing the value of any of the flags. (camel_imap_folder_changed): Deal with EXISTS rather than RECENT. * providers/imap/camel-imap-store.c (imap_connect): Call camel_session_get_storage_path and save the value. (get_folder): Create a local directory to store summary information and pass a summary file name to camel_imap_folder_new. Don't call camel_folder_refresh_info from here any more since camel_imap_folder_new does it again. * providers/imap/camel-imap-command.c (camel_imap_command): Add a special case to this to make it possible to get the repsonses from a SELECT and still have store->current_folder be updated correctly. (imap_read_response): parse EXISTS rather than RECENT * camel-session.c (camel_session_get_storage_path): Use e_mkdir_hier. * camel-folder-summary.c (camel_folder_summary_remove_index): New function. * camel-mime-utils.c (header_raw_append_parse): fix this. (camel-mime-parser.c doesn't use this code because of the MEMPOOL optimization, so nothing was ever actually calling it before.) svn path=/trunk/; revision=5891
* Removed temp_message_buffer, and content_input_stream fields which seem toNot Zed2000-10-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-11 Not Zed <NotZed@HelixCode.com> * camel-mime-part.h (struct _CamelMimePart): Removed temp_message_buffer, and content_input_stream fields which seem to have come from nowhere, and are unused. * camel-mime-utils.c: Added a note about touching this file. Nobody is to touch it without asking me first. That goes for you too Jeff. (header_decode_text): In what way is this broken? 2000-10-10 Not Zed <NotZed@HelixCode.com> * providers/imap/camel-imap-folder.c (imap_get_summary_internal): Fix camel_summary_* function rename (imap_get_message_info_internal): Likewise. * camel-mime-parser.c (camel_mime_parser_finalise): Fixed a spelling mistake. * camel-folder-summary.c (camel_summary_format_address): Uh, why do we encode and then decode here ... sigh. This is not the way to fix this. (camel_folder_summary_format_address): Renamed to a proper name, this was only supposed to be a private function. (camel_folder_summary_format_string): Likewise. Oh i see why it was made public, code reuse by cut & paste. Joy. svn path=/trunk/; revision=5881
* Decode the resulting string.Jeffrey Stedfast2000-10-071-6/+10
| | | | | | | | | 2000-10-06 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-summary.c (camel_summary_format_address): Decode the resulting string. svn path=/trunk/; revision=5773
* Handle the case where ct != NULL, but type and subtype are, and also matchNot Zed2000-10-041-12/+35
| | | | | | | | | | | | | | | | | | | | | | 2000-10-04 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_content_type_is): Handle the case where ct != NULL, but type and subtype are, and also match that against text/plain. * camel-folder-summary.c: Bump summary file version. (message_info_save): Save the size from the messageinfo. (message_info_load): Load the size from the summary file. (message_info_load): Fixed up the time_t saving/loading. There was a reason the warning was left there ... obviously nobody could read the comment "/* warnings, leave them here */", why do i even bother. (camel_folder_summary_decode_time_t): Decode a time_t value from the summary file. (camel_folder_summary_encode_time_t): Encode a time_t value to the summary file. svn path=/trunk/; revision=5706
* Remove camel_folder_{get,free}_subfolder_info, as we want to be able toDan Winship2000-10-031-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-folder.[ch]: Remove camel_folder_{get,free}_subfolder_info, as we want to be able to scan the whole subfolder tree without having to open any folders, so this needs to be in CamelStore. Remove can_hold_folders and can_hold_messages flags; things that don't hold messages are no longer considered CamelFolders. * camel-folder-summary.[ch]: Remove CamelFolderInfo stuff. * camel-store.[ch]: Add camel_store_{get,free}_folder_info, as well as camel_store_free_folder_info_full and ..._nop for default implementations, and camel_folder_info_free and camel_folder_info_build as convenience functions. Turn CamelFolderInfo into a tree structure and also add an "url" member. * providers/*/camel-*-folder.c: Remove subfolder_info and can_hold stuff. * providers/*/camel-*-store.c: Add folder_info stuff. * providers/imap/camel-imap-folder.c (imap_summary_free): Free the summary elements with camel_message_info_free, not camel_folder_info_free. Oops. * providers/imap/camel-imap-utils.c: const poison svn path=/trunk/; revision=5663
* New function to fold headers.Not Zed2000-09-281-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-09-28 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_fold): New function to fold headers. 2000-09-27 Not Zed <NotZed@HelixCode.com> * camel-mime-parser.c (folder_scan_header): If we had an empty header, then it must be end of the headers too. (folder_scan_init): No we dont need to init the outbuf with a nul terminator. * camel-folder-summary.c (camel_folder_summary_set_uid): New function to reset the uid to a higher value. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync): "something failed (yo!)" what sort of crap is this? Fixed all the indenting again, what wanker keeps running stuff through indent? (message_info_new): Check the uid we loaded off the disk, if it existed already, assign a new one. If it didn't then make sure the nextuid is higher. * camel-charset-map.c: New file, used to build a large unicode decoding mapping table, and use it to determine what is the lowest charset a given word can be encoded with. Uses tables from libunicode's source. * camel-internet-address.c (internet_encode): Use header_phrase_encode to properly encode the fullname, as required. refixed indenting. Who keeps doing that? (camel_internet_address_find_address): Changed fatal return/warnings into assertions. * camel-mime-utils.c (header_raw_append_parse): Check : explicitly (removed from is_fieldname() macro). (camel_mime_special_table): Changed to short, so we can represent more bit types. (quoted_encode): Take a mask of the safe chars for this encoding. (header_address_decode): Removed a #warning that makes no sense anymore. (header_decode_date): Fixed the 'broken date' parser code, if it ever decoded it it just threw away the result. (header_encode_string): Use better charset matching for encoding strings as well. 2000-08-31 Not Zed <NotZed@HelixCode.com> * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Save the index if we do a sync. (camel_mh_summary_check): Save the index here too. Probably. svn path=/trunk/; revision=5615
* update CamelFolderInfo New function to free the contents of aDan Winship2000-09-181-0/+14
| | | | | | | | * camel-folder-summary.h: update CamelFolderInfo * camel-folder-summary.c (camel_folder_info_free): New function to free the contents of a CamelFolderInfo svn path=/trunk/; revision=5476
* More UTF-8 handlingLauris Kaplinski2000-08-251-4/+4
| | | | svn path=/trunk/; revision=5032
* Fixed some warnings.Christopher James Lahey2000-08-111-1/+1
| | | | | | | | | | | | | | | | 2000-08-10 Christopher James Lahey <clahey@helixcode.com> * camel-folder-search.c, camel-folder-summary.c, camel-medium.c, camel-mime-filter-charset.c, camel-mime-filter.c, camel-mime-filter.h, camel-mime-message.c, camel-mime-parser.c, camel-mime-part-utils.c, camel-mime-part.c, camel-mime-utils.c, camel-movemail.c, camel-multipart.c, camel-object.c, camel-stream-mem.c, providers/mbox/camel-mbox-folder.c, providers/mbox/camel-mbox-summary.c, providers/mh/camel-mh-folder.c, providers/smtp/camel-smtp-transport.c: Fixed some warnings. svn path=/trunk/; revision=4719
* Merge with camel-async.Peter Williams2000-08-111-62/+44
| | | | svn path=/trunk/; revision=4687
* A better way to compress leading whitespace. The code is probably invalidNot Zed2000-08-111-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-08-11 Not Zed <NotZed@HelixCode.com> * camel-mime-parser.c (folder_scan_header): A better way to compress leading whitespace. The code is probably invalid anyway, I dont think it will work across buffer boundaries. * providers/mbox/camel-mbox-folder.c (mbox_append_message): And write out proper format From lines here too. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_build_from): New function to build a more compatible mbox "From " line. (camel_mbox_summary_sync): Write From lines in the proper format. 2000-08-10 Not Zed <NotZed@HelixCode.com> * providers/mh/camel-mh-store.c (get_folder): Remove warnin g. * providers/mbox/camel-mbox-store.c (xrename): Kill some warnings with constification. * providers/imap/camel-imap-folder.c (imap_append_message): Fixed for append api change. Eek this routine seriously wastes memory. * providers/mh/camel-mh-folder.c (mh_search_free): Impelemnt. (mh_append_message): Fix for api change, and include user flags and tags in new message. * providers/vee/camel-vee-folder.c (vee_search_by_expression): Fix for search api change. * camel-folder.c (camel_folder_search_free): New function for freeing search results. (search_free): Changed my mind, implement a default that actually does something. Free as to the old interface. (camel_folder_append_message): Changed to accept a camelmessageinfo rather than flags, which just doesn't have enough info in it. (copy_message_to): Change for append_message api change. (move_message_to): Likewise. * providers/mbox/camel-mbox-folder.c (mbox_search_free): Implement. (mbox_append_message): Fix for api change, and also copy user flags/tags across to new summary. * camel-folder-search.c (search_user_tag): A search expression that returns the current use flag by name. (camel_folder_search_free_result): New function to free the result of a search. * camel-folder-summary.c: Bump summary version. (message_info_new): (message_info_load): (message_info_save): (camel_message_info_dup_to): (camel_message_info_free): Added support for arbitrary tag/value pairs (CamelTag's). (camel_tag_get): (camel_tag_set): (camel_tag_list_size): (camel_tag_list_free): Operations for working with CamelTags. svn path=/trunk/; revision=4683
* Oops, an unsigned integer can never be < 0Jeffrey Stedfast2000-07-111-1/+1
| | | | | | | | | 2000-07-10 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-summary.c (camel_folder_summary_decode_string): Oops, an unsigned integer can never be < 0 svn path=/trunk/; revision=4077
* Cleaned up a bunch of compile warningsJeffrey Stedfast2000-07-111-12/+19
| | | | | | | | 2000-07-10 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-summary.c: Cleaned up a bunch of compile warnings svn path=/trunk/; revision=4055
* New function to copy a header_references structure.Dan Winship2000-07-101-9/+62
| | | | | | | | | | | | | | | | | | | | * camel-mime-utils.c (header_references_dup): New function to copy a header_references structure. * camel-folder-summary.c (camel_message_info_dup_to): New function to (deep) copy the data from one CamelMessageInfo into another. (camel_message_info_free): And free the data. * providers/vee/camel-vee-folder.c (vee_sync): Implement. (empty). (vee_search_by_expression): belatedly update for camel_folder_search change. (vee_folder_build): belatedly update for camel_folder_search change. Use camel_message_info_dup_to and camel_message_info_free (in particular, so that we get message_id and references info so vfolders can be threaded). (vee_folder_build_folder): Ditto. svn path=/trunk/; revision=4024
* Parse for more header information to allow message threading in IMAP.Jeffrey Stedfast2000-07-071-8/+8
| | | | | | | | | | | | | 2000-07-06 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): Parse for more header information to allow message threading in IMAP. (imap_get_message_info): Same. * camel-folder-summary.c: Renamed summary_format_* to camel_summary_format_* and moved them into public scope. svn path=/trunk/; revision=3925
* remove some non-error case debugging messages.Dan Winship2000-07-061-13/+1
| | | | | | * remove some non-error case debugging messages. svn path=/trunk/; revision=3904
* Fix the "clashing UIDs are not updated on disk" problem by syncingEttore Perazzoli2000-07-061-7/+2
| | | | | | | | | | back to disk even if the saved UID does not match the in-memory UID and added some debugging messages. Also, make sure the UID we use for Ibex stuff is the new one when changing UIDs to solve a clashing problem. svn path=/trunk/; revision=3892
* Add "Cc" to summary and bump summary version number.Dan Winship2000-07-061-1/+6
| | | | | | | | | | * camel-folder-summary.c: Add "Cc" to summary and bump summary version number. * camel-folder-search.c (search_header_contains): make "Cc" a searchable header. svn path=/trunk/; revision=3888
* Centralize creation of new UIDs for the summary.Ettore Perazzoli2000-07-041-2/+8
| | | | svn path=/trunk/; revision=3885
* Get rid of unused function `camel_folder_summary_set_uid()'.Ettore Perazzoli2000-07-041-7/+0
| | | | svn path=/trunk/; revision=3882
* Parse In-Reply-To with header_references_decode, not header_msgid_decode.Dan Winship2000-07-031-7/+3
| | | | | | | | | | * camel-folder-summary.c (message_info_new): Parse In-Reply-To with header_references_decode, not header_msgid_decode. * camel-mime-message.c (camel_mime_message_class_init): message headers are case-insensitive. svn path=/trunk/; revision=3870
* Set date_received based on the first (most recent) "Received" header.Dan Winship2000-06-221-1/+8
| | | | | | | * camel-folder-summary.c (message_info_new): Set date_received based on the first (most recent) "Received" header. svn path=/trunk/; revision=3677
* mark the message info with CAMEL_MESSAGE_FOLDER_FLAGGED if we change theDan Winship2000-06-211-0/+1
| | | | | | | | * camel-folder-summary.c (camel_folder_summary_add): mark the message info with CAMEL_MESSAGE_FOLDER_FLAGGED if we change the uid, so the folder will know that it's dirty. svn path=/trunk/; revision=3647
* Move flag handling from CamelMimeMessage to CamelFolder. ThisDan Winship2000-06-171-2/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simplifies several flag-handling pieces of code in the mailer, and lets you change a message's flags without having to fetch the message body. It also means that fully-constructed CamelMimeMessages are now essentially constant, which will help simplify locking issues later since it means two threads interested in the same message can just work with separate copies of it. * camel-mime-message.h (struct _CamelMimeMessage): Removed flags and user_flags (moved to summary). Removed expunged and message_number which were unused. Removed message_uid and folder which are no longer needed in the new scheme. (struct CamelMimeMessageClass): Removed message_changed signal and get/set_message_number methods. * camel-mime-message.c: Updates for CamelMimeMessage changes. (camel_mime_message_get/set_flags, camel_mime_message_get/set_user_flag): Replaced with methods in CamelFolder. (camel_flag_get, camel_flag_set, camel_flag_list_size, camel_flag_list_free): Moved verbatim to camel-folder-summary.c * camel-folder.c (camel_folder_get/set_message_flags, camel_folder_get/set_message_user_flag): New methods (and corresponding useless default implementations) (camel_folder_class_init): add a message_changed signal * camel-folder-summary.c (camel_flag_get, camel_flag_set, camel_flag_list_size, camel_flag_list_free): Moved here from camel-mime-message.c * providers/mbox/camel-mbox-folder.c (message_changed): Removed. (mbox_get_message_flags, mbox_set_message_flags, mbox_get_message_user_flag, mbox_set_message_user_flag): Tweak summary bits as appropriate. (Functionality moved here from message_changed.) (mbox_get_message_by_uid): Update for CamelMimeMessage changes (less stuff to initialize). * providers/imap/camel-imap-folder.c (message_changed): Remove this. It was just copied from the mbox provider and doesn't deal with the real IMAP flag stuff anyway. (So there's currently no flag support in the IMAP provider.) (imap_get_message_by_uid): Update for CamelMimeMessage changes. * providers/vee/camel-vee-folder.c: (message_changed): Remove old one. Add a new one to listen for message_changed on each folder and re-emit message_changed signals that correspond to messages in the vfolder. (vee_get/set_message_flags, vee_get/set_message_user_flag): Proxy flag setting to the underlying real messages. (vee_append_message): Removed for now; there's no way to translate this into the new CamelMimeMessage/CamelFolder scheme, but (a) there's also no code which would ever call it and (b) we're probably going want a better interface than append_message for message drag and drop to work anyway. To be revisited. svn path=/trunk/; revision=3598
* KLUDGE! Since neither ETable nor GtkHTML supports UTF-8 yet, outputDan Winship2000-06-171-4/+4
| | | | | | | | | | | * camel-mime-utils.c (rfc2047_decode_word): * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): * camel-folder-summary.c (summary_build_content_info): KLUDGE! Since neither ETable nor GtkHTML supports UTF-8 yet, output ISO-8859-1 instead, so Ettore can read his Italian mail. :) This will be reverted later. svn path=/trunk/; revision=3597
* If we get a funny result, just throw it out. Basically a fix for the oneNot Zed2000-06-031-2/+33
| | | | | | | | | | | | | | | | | | | | | | 2000-06-02 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_decode_date): If we get a funny result, just throw it out. Basically a fix for the one true broken TradeClient. 2000-06-01 Not Zed <NotZed@HelixCode.com> * camel-folder-summary.c (message_info_free): Free references/messsage id. (message_info_save): Save them. (message_info_load): Load them. (message_info_new): And get them from the new message. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped for new changes. * camel-folder-summary.h: Added references and messageid to summary. svn path=/trunk/; revision=3391
* Guess!NotZed2000-05-191-1/+3
| | | | | | | | | | | | | | | | | 2000-05-18 NotZed <NotZed@HelixCode.com> * providers/vee/camel-vee-folder.c: Guess! * camel-folder-search.c (search_user_flag): Implement user_flag search term. * camel-folder-search.h: Added user_flag search capability (user-flag "blah") * providers/mbox/camel-mbox-folder.c (mbox_init): Set USER flag in permanent flags for the folder. svn path=/trunk/; revision=3122
* Quick fix to get it to compile. I hope I don't get into trouble.Darin Adler2000-05-181-1/+2
| | | | | | | * camel-folder-summary.c: (message_info_load): Quick fix to get it to compile. I hope I don't get into trouble. svn path=/trunk/; revision=3110
* All this basically to support user flags in the summary. They are not yetNotZed2000-05-181-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All this basically to support user flags in the summary. They are not yet saved to the message headers (complicates things a bit). 2000-05-17 NotZed <NotZed@HelixCode.com> * providers/mbox/camel-mbox-folder.c (message_changed): Snoop changes to user flags on the message into the summary as well. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_init): Changed version init to include the parent class version info (i.e. add it not overwrite it). * camel-folder-summary.c (message_info_new): Initialise user_flags to empty. (message_info_load): And load user flags. (message_info_save): And save user flags. (message_info_free): And free them. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped file revision. * camel-folder-summary.h: Added user-flags to summary. * camel-mime-message.c (camel_mime_message_set_user_flag): Dont use a hashtable for user flags. (camel_mime_message_get_user_flag): And changed here too. (camel_flag_get): New interface to get a flag from a flag list. Flag lists are easier to work with than hash tables, and save memory too. (camel_flag_set): And set. (camel_flag_list_free): And free. (free_key_only): Discard. (finalize): Remove the flag list. svn path=/trunk/; revision=3107
* > * providers/mbox/camel-mbox-folder.c (message_changed): IndicateMichael Zucci2000-05-121-1/+10
| | | | | | | | | | | | | | | | > the summary changed also. > > (camel_mbox_summary_update): Also save summary when done. > (camel_mbox_summary_expunge): Unindex items when deleting them. > (camel_mbox_summary_expunge): Save the index as well as the > summary. > (camel_folder_summary_touch): New function, indicate the summary > info changed. > (camel_folder_summary_remove): Dirty here. svn path=/trunk/; revision=2994
* Big bunch o memleaks fixed.NotZed2000-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 2000-05-11 NotZed <NotZed@HelixCode.com> * camel-mime-part.c (write_to_stream): Unref the filter after adding it to the filtering stream. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_finalise): Free the folder path. * camel-folder-summary.c (camel_folder_summary_finalise): Free the summary path. * camel-internet-address.c (internet_decode): Free multiple entry addresses properly. * camel-mime-utils.c (header_decode_mailbox): Plugged another memleak, free text after converting it. (header_decode_addrspec): More leaks plugged. * camel-mime-message.c (finalize): Free message_uid. (finalize): Free the recipients hashtable. svn path=/trunk/; revision=2989
* Free summary items and charset filters.12000-05-121-4/+10
| | | | | | | | | | | | | | | | | 2000-05-11 <notzed@helixcode.com> * camel-folder-summary.c (camel_folder_summary_finalise): Free summary items and charset filters. 2000-05-10 <notzed@helixcode.com> * camel-folder-summary.c (camel_folder_summary_finalise): Don't free stuff in p, after we've free'd p. * providers/mbox/camel-mbox-folder.c (mbox_append_message): Unref the stream we created for appending. svn path=/trunk/; revision=2986
* Merged NEW_SUMMARY branch back to trunk, and resolved conflicts.NotZed2000-05-081-25/+263
| | | | | | | | | | | | | 2000-05-08 NotZed <NotZed@HelixCode.com> * Merged NEW_SUMMARY branch back to trunk, and resolved conflicts. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_update): Return status. * camel-stream-filter.c (do_close): We NEED a stream close. svn path=/trunk/; revision=2906
* Make camel not leak like a sieve.Dan Winship2000-05-081-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-object.c: New subclass of GtkObject which is now the base of the Camel object hierarchy. Currently the only difference between CamelObject and GtkObject is that CamelObjects don't start out floating. * *.h: Move a bunch of typedefs to camel-types.h. Standardize on using <camel/foo.h> in header files rather than <foo.h>, "foo.h", or "camel/foo.h". Remove some unneeded includes. * camel-address.c, camel-data-wrapper.c, camel-folder-search.c, camel-folder-summary.c, camel-folder.c, camel-mime-filter.c, camel-mime-parser.c, camel-service.c, camel-session.c, camel-stream.c: These are now subclasses of CamelObject. * camel-data-wrapper.c (set_output_stream): * camel-medium.c (set_content_object): * camel-seekable-substream.c (init_with_seekable_stream_and_bounds): * providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid): remove gtk_object_sink calls. * camel-stream-buffer.c (init_vbuf): * camel-stream-filter.c (camel_stream_filter_new_with_stream): ref the original stream. * camel-folder-summary.c (camel_folder_summary_finalise): unref the filters when finalizing. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser, camel_mime_part_construct_content_from_parser): * camel-mime-part.c (camel_mime_part_set_content): Unref objects that are created only to be handed off to other objects. If they're going to be needed later, they will have been additionally ref'ed by the object that needs them. * providers/pop3/camel-pop3-folder.c (get_message_by_number): unref the message stream after creating the data from it. * camel-stream.c, camel-stream-buffer.c, camel-stream-filter.c, camel-stream-fs.c, camel-stream-mem.c: Remove camel_stream_close, since its semantics are dubious (what happens when you close a stream other people still have references on?). * providers/nntp/camel-nntp-store.c: * providers/smtp/camel-smtp-transport.c: * providers/pop3/camel-pop3-store.c: replace camel_stream_close calls with gtk_object_unref. * providers/mbox/camel-mbox-folder.c: * providers/nntp/camel-nntp-folder.c: * providers/sendmail/camel-sendmail-transport.c: replace camel_stream_close with camel_stream_flush + gtk_object_unref svn path=/trunk/; revision=2882
* And same here ... (camel_folder_summary_encode_fixed_int32): Ugh, fwriteNotZed2000-05-061-7/+16
| | | | | | | | | | | | 2000-05-05 NotZed <NotZed@HelixCode.com> * camel-folder-summary.c: And same here ... (camel_folder_summary_encode_fixed_int32): Ugh, fwrite doesn't return -1 on error .. (camel_folder_summary_decode_fixed_int32): Neither deos fread. (camel_folder_summary_encode_token): Fix here too. svn path=/trunk/; revision=2819
* And same here ...NotZed2000-05-051-9/+10
| | | | | | | | | | | | | | | | | | | | | | 2000-05-05 NotZed <NotZed@HelixCode.com> * camel-folder-summary.c: And same here ... * camel-mime-utils.c: Defined out some memory profiling stuff I left there by mistake. * camel-mime-parser.c (folder_scan_content): Apply the fix from the header scanner to here too. (folder_scan_header): Only check for end of header if we have space for it (didn't end the read with a newline) (folder_scan_header): inptr is the only real thing we need registerised for performance. Try to help the compiler be smart about it .. (folder_scan_header): Simplified the save header case a tad. Commented out some memory profiling stuff. svn path=/trunk/; revision=2811
* Plug a memory leak. (header_decode_text): Fixed memory leaks with52000-05-051-2/+6
| | | | | | | | | | | | | | | | | | 2000-05-05 <notzed@helixcode.com> * camel-mime-utils.c (header_decode_mailbox): Plug a memory leak. (header_decode_text): Fixed memory leaks with g_string_append(). (header_encode_string): And here too, and a few other places. The glib api is so awful ... (header_content_type_decode): More memory leaks, more left ... 2000-05-05 <notzed@helixcode.com> * camel-mime-parser.c (folder_scan_init_with_fd): Make sure we init the end of buffer sentinal! (folder_scan_init_with_stream): And here too ... svn path=/trunk/; revision=2810
* Maxcount is minimum of the max and the requested count, not the maximum :)NotZed2000-05-051-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-05-04 NotZed <NotZed@HelixCode.com> * providers/mbox/camel-mbox-folder.c (summary_get_message_info): Maxcount is minimum of the max and the requested count, not the maximum :) * camel-mime-parser.c (folder_scan_content): Properly set midline, so we dont falsely catch offset boundary markers (i.e. From inside content). (folder_read): Set a sentinal on the end of the read data (\n) so we dont have to check the buffer boundary in the inner loop. (mempool_*): New experimental memory management routines, speed up simple structure parsing by about 25% ... not compiled in by default. Something similar may be needed for camel-mime-utils to address performance issues with g_malloc and friends. * camel-mime-utils.c: Added a macro w(x) used to wrap all warnings about mime/rfc violations, so they can be turned off. * camel-folder-summary.c (summary_build_content_info): Step after the end of a message ... Turn into a stand-alone program for testing and profiling. svn path=/trunk/; revision=2808
* No, we're not going to have g_strcasecmp for no good reason,NotZed2000-05-041-0/+1041
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not even if its slipped in with no changelog. 2000-05-04 NotZed <NotZed@HelixCode.com> * providers/mbox/camel-mbox-summary.c: Yes, and anotherone. * camel-mime-utils.c: And another one. * camel-mime-part.c: And another one. * camel-mime-part-utils.c: And another one. * camel-folder-search.c: And another one. * camel-mime-parser.c: Reverted a change wihtout a ChangeLog entry. 2000-05-04 NotZed <NotZed@HelixCode.com> * camel-folder-summary.[hc]: Yes, CamelFolderSummary is back ... ... re-usable class to summarise and index any stream or message and to manage/load/save the created summaries. * camel-folder.c: Include string.h to kill a warning. 2000-05-03 NotZed <NotZed@HelixCode.com> * camel-folder.h: Added pos/bodypos/endpos to the basic message content info object. Size to be removed? Moved the messageconentinfo and messageinfo back to camel-folder-summary.h. * camel-mime-filter-index.c (camel_mime_filter_index_set_ibex): New function to (re)set the index to use on a filter. * camel-mime-parser.c (camel_mime_parser_scan_from): Whole bunch of inline docs. (camel_mime_parser_drop_step): New function to drop a state from the parser. Needs more testing. svn path=/trunk/; revision=2789
* > * gmime-utils.[ch]: What the hell, remove it. This will break theMichael Zucci2000-05-031-177/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | > nntp provider (but its broken anyway). The mime parser can be > used instead though. > Removed from all code including it (but none were using it). > > * gmime-utils.c (_store_header_pair_from_string): Removed bizarre > string_dichotomy version of this. This code is somewhat redundant > now, and is headed for death anyway. > > * gstring-util.c (g_string_dichotomy): Same with this one. > (g_string_clone): Removed a memory leak, g_string_new() allocates > its own memory. > (g_string_append_g_string): Allow to append an empty gstring onto > another gstring, dont abort()! > > * string-utils.c (string_dichotomy): Removed this incredibly weird > function. > > * camel-folder.c (_create): Replaced the rather obtuse use of > "string_dichotomy" function with a simple strrchr(). Still not > sure it'll work. > > * camel-folder-summary.c: cvs removed a long-removed file. svn path=/trunk/; revision=2753
* kill camel-logDan Winship2000-04-191-1/+0
| | | | svn path=/trunk/; revision=2487
* change the CamelFolderSummary interfaces to allow partial summary queriesDan Winship2000-03-251-71/+87
| | | | | | | | | | | | | | | | | | | | | | | | * camel-folder-summary.[ch]: change the CamelFolderSummary interfaces to allow partial summary queries (for dealing with very large folders). Remove the "extended_fields" from CamelFolderInfo and CamelMessageInfo: this is better dealt with by subtyping. * providers/mbox/camel-mbox-summary.[ch]: Make CamelMboxSummary a subclass of CamelFolderSummary. Update interfaces for that. Remove the internal/external summary distinction. Remove the (unused) md5 checksum in the folder summary. Change the summary file format (primarily to make it no longer byte-order dependent) and add a version number to it so it will be easier to change in the future. * providers/mbox/camel-mbox-folder.[ch] * providers/mbox/camel-mbox-search.c * providers/mbox/camel-mbox-utils.c: update for summary changes * camel-exception-list.def: add CAMEL_EXCEPTION_FOLDER_SUMMARY_INVALID svn path=/trunk/; revision=2159
* fix the name of "Helix Code, Inc." in all the copyrightsDan Winship2000-03-101-1/+1
| | | | svn path=/trunk/; revision=2091
* renamed mbox_folder->summary to mbox_folder->internal_summary to avoidbertrand2000-01-261-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-01-26 bertrand <bertrand@helixcode.com> * camel/providers/mbox/camel-mbox-folder.c: renamed mbox_folder->summary to mbox_folder->internal_summary to avoid confusion with the camel_folder->summary field. (_append_message): (_check_get_or_maybe_generate_summary_file): update the external summary thingie. * camel/camel-folder-summary.c (camel_folder_summary_new): create the message and folder info arrays. * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_summary_append_internal_to_external): new function to append entries from the internal summary to the external one. * camel/providers/mbox/camel-mbox-folder.c (_append_message): reflect name change. * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_summary_append_entries): namespace fix. svn path=/trunk/; revision=1632
* tests for summary and parsing process of mbox files.bertrand2000-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 2000-01-18 bertrand <bertrand@helixcode.com> * tests/test9.c: tests for summary and parsing process of mbox files. * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): do not use case insensitive comp to detect message separators. Kill some nasty bugs in netscape file parsing, * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary): don't use g_array_append but write directly inside the array data instead. Better performance and bug fix. * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_load_summary): fix the name and bugs. * camel/camel-folder-summary.h: update the class method definition to match the public defs. svn path=/trunk/; revision=1592
* summary file read/write routines.bertrand2000-01-191-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-01-18 bertrand <bertrand@helixcode.com> * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary): (mbox_load_summary): summary file read/write routines. * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary): routine to construct the summary after the mbox file has been parsed and the x-evolution fields inserted. * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): dont use the x_evolution field but rather the uid to determine the presence of "X-Evolution" in the mail. * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): parse the status and uid values if the x-evolution has been found. * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_xev_parse_header_content): return the parsed status field correctly. * camel/providers/mbox/camel-mbox-utils.h: fixed bad prototype. * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): parse and store the "To:" header. * camel/providers/mbox/camel-mbox-parser.h: added a "to" field * camel/camel-folder-summary.c: create the arrays here. * camel/camel-folder-summary.h: the list of summary information is no longer a GList but rather a GArray. Parsing/summary/sync-check is here. Needs testing and integration with the rest of the folder code. svn path=/trunk/; revision=1589
* Updated my e-mail address to reflect my new employmentBertrand Guiheneuf2000-01-041-1/+1
| | | | svn path=/trunk/; revision=1533
* Fix copyright informations once againBertrand Guiheneuf1999-12-151-1/+1
| | | | svn path=/trunk/; revision=1489
* Copyright changeBertrand Guiheneuf1999-10-231-1/+4
| | | | svn path=/trunk/; revision=1348
* started summary implementation. (_open): correct use of open.bertrand1999-09-051-2/+10
| | | | | | | | | | | | | 1999-09-04 bertrand <Bertrand.Guiheneuf@aful.org> * camel/providers/MH/camel-mh-folder.c (_create_summary): started summary implementation. (_open): correct use of open. * camel/camel-folder.c (camel_folder_get_summary): get folder associated summary object. svn path=/trunk/; revision=1177
* added summary files buildbertrand1999-09-041-0/+136
1999-09-04 bertrand <Bertrand.Guiheneuf@aful.org> * camel/Makefile.am: added summary files build * camel/camel-folder-summary.[ch]: basic summary framework svn path=/trunk/; revision=1176