aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local
Commit message (Collapse)AuthorAgeFilesLines
* This commit was manufactured by cvs2svn to create tag 'GAL_0_8'.GAL_0_8nobody2001-05-1929-5671/+0
| | | | svn path=/tags/GAL_0_8/; revision=9892
* new abstract class for disconnectable remote storesDan Winship2001-05-041-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-disco-store.c: new abstract class for disconnectable remote stores * camel-disco-folder.c: new abstract class for folders on disconnectable stores. * Makefile.am: Add camel-disco-folder.[ch] and camel-disco-store.[ch]. * providers/imap/camel-imap-store.c: Make this a subclass of CamelDiscoStore, and fix up the offline interfaces for the changes since they were first written (particularly the fact that some IMAP stores don't just use subscribed folders). * providers/imap/camel-imap-folder.c: Make this a subclass of CamelDiscoFolder, although most ops still fail in disconnected mode. * camel-store.c (camel_store_get_folder_info): Change gboolean, gboolean, gboolean to guint32 in the prototype for this function. * providers/local/camel-local-store.c (get_folder_info): Update for prototype change. svn path=/trunk/; revision=9659
* New file, with the int, string, time_t, and off_t encode/decode routinesDan Winship2001-04-271-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Remove UNICODE_CFLAGS (and some other stuff that's redundant withDan Winship2001-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (INCLUDES): Remove UNICODE_CFLAGS (and some other stuff that's redundant with EXTRA_GNOME_CFLAGS) (libcamel_la_LIBADD): Replace UNICODE_LIBS with GAL_LIBS. * camel-search-private.c: * camel-pgp-context.c: * camel-mime-utils.c: Use gunicode interfaces rather than libunicode. * camel-charset-map.c: Use gunicode rather than libunicode. (The charmap-regen code still depends on libunicode though.) * camel-mime-filter-charset.h: * tests/message/test2.c (convert): Use iconv rather than unicode_iconv. * providers/smtp/Makefile.am (libcamelsmtp_la_LIBADD): * providers/pop3/Makefile.am (libcamelpop3_la_LIBADD): * providers/local/Makefile.am (libcamellocal_la_LIBADD): Remove UNICODE_LIBS. * camel.c (camel_init): Remove call to unicode_init. * camel-mime-parser.c: Remove unused unicode.h include. svn path=/trunk/; revision=9585
* Applied jacob's patches for e-poolv stuff.Not Zed2001-04-262-10/+18
| | | | | | | | 2001-04-26 Not Zed <NotZed@Ximian.com> * Applied jacob's patches for e-poolv stuff. svn path=/trunk/; revision=9571
* Don't we want to tell where we are by using the start of the message? IJeffrey Stedfast2001-04-171-5/+5
| | | | | | | | | | | | | 2001-04-16 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-mbox-summary.c (summary_rebuild): Don't we want to tell where we are by using the start of the message? I think this should be using camel_mime_parser_tell_start_from() instead. Also divide by the size *before* multiplying by 100 so that we don't overflow the int which was giving us negative values for our progress status (oops). svn path=/trunk/; revision=9394
* Check if gethostbyname_r take five paramsJP Rosevear2001-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-11 JP Rosevear <jpr@ximian.com> * configure.in: Check if gethostbyname_r take five params * acconfig.h: add GETHOSTBYNAME_R_FIVE_ARGS 2001-04-11 JP Rosevear <jpr@ximian.com> * providers/imap/Makefile.am: user GNOME_INCLUDEDIR since gnome files are included in the top level camel headers and the gtk include dir is now versioned and such * providers/local/Makefile.am: ditto * providers/pop3/Makefile.am: ditto * providers/smtp/Makefile.am: ditto * providers/sendmail/Makefile.am: ditto * camel-service.c: use five arg version of gethostbyname_r if appropriate (camel_get_host_byname): check if msg->herr is non-zero instead of checking if msg->hp is null since we may not always have msg->hp svn path=/trunk/; revision=9239
* 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
* Big header cleanups and nntp compile fixKjartan Maraas2001-03-3013-14/+47
| | | | svn path=/trunk/; revision=9024
* add a "GList *authtypes", so you can get the list of authtypes used by aDan Winship2001-03-221-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-provider.h: (CamelProvider) add a "GList *authtypes", so you can get the list of authtypes used by a provider without needing to have an actual CamelService object handy. (Will be needed by the new config druid.) (CAMEL_PROVIDER_ALLOWS, CAMEL_PROVIDER_NEEDS): New macros to test the URL part stuff, since the way it works is too complicated and everyone always does it wrong. * camel-service.c (camel_service_query_auth_types): Remove the @connected arg again: if you don't want to connect, you can just get the list of authtypes off the provider. (camel_service_free_auth_types): Remove this. All existing implementations do authtypes the same way, so just say the caller should "g_list_free" the list. (Oh, look, removing this function doesn't actually cause the mailer to not build. How 'bout that.) (construct, get_path): Use the new URL part macros. * camel-remote-store.c (remote_query_auth_types): Update (remote_free_auth_types): Nuke (camel_remote_store_authtype_list): New function for use by subclasses. * providers/imap/camel-imap-provider.c: * providers/pop3/camel-pop3-provider.c: * providers/smtp/camel-smtp-provider.c: Update CamelProvider structures. (camel_provider_module_init): Put all the SSL parts together so there's only 1 #ifdef. Set up the provider authtypes field using the SASL, CamelRemoteStore, and standard authtypes, as appropriate. Copy that from the normal provider to the SSL provider. * providers/local/camel-local-provider.c: * providers/sendmail/camel-sendmail-provider.c: * camel-session.c: Update CamelProvider structures. * providers/imap/camel-imap-store.c (query_auth_types): * providers/pop3/camel-pop3-store.c (query_auth_types): Update * providers/smtp/camel-smtp-store.c (query_auth_types): Update. Remove the no_authtype, because that's what "ALLOW_AUTH" rather than "NEED_AUTH" means. (free_auth_types): Nuke. svn path=/trunk/; revision=8872
* Modified patch from Dan Berger <dberger@ix.netcom.com> to re-check theNot Zed2001-03-171-0/+3
| | | | | | | | | | 2001-03-17 Not Zed <NotZed@Ximian.com> * providers/local/camel-maildir-summary.c (maildir_summary_sync): Modified patch from Dan Berger <dberger@ix.netcom.com> to re-check the maildir directory for new/updated messages at sync time. svn path=/trunk/; revision=8781
* Remove some unused stuffDan Winship2001-03-071-59/+0
| | | | | | | | * providers/local/camel-mbox-provider.c: * providers/vee/.cvsignore: * providers/vee/libcamelvee.urls: Remove some unused stuff svn path=/trunk/; revision=8582
* Emit the folder_created signal here.Jeffrey Stedfast2001-02-162-1/+27
| | | | | | | | | | | | | | | | | | | | | | | 2001-02-15 Jeffrey Stedfast <fejj@ximian.com> * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Emit the folder_created signal here. * providers/local/camel-local-folder.c (camel_local_folder_construct): Emit the folder_created signal. * providers/local/camel-local-store.c (delete_folder): On error, free the 'name' string so we don't leak. Also emit the folder_deleted signal. * providers/imap/camel-imap-store.c (subscribe_folder): Emit the folder_created signal. (unsubscribe_folder): Emit the folder_deleted signal. * camel-store.c (camel_store_class_init): Added folder_created and folder_deleted signal defs. svn path=/trunk/; revision=8246
* mbox, mh, and maildir camel-url's need absolute paths.Jeffrey Stedfast2001-02-131-3/+3
| | | | | | | | | | | 2001-02-12 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-local-provider.c: mbox, mh, and maildir camel-url's need absolute paths. * camel-provider.h (CAMEL_URL_PATH_IS_ABSOLUTE): New flaggy flag. svn path=/trunk/; revision=8193
* Rewrite a bunch. Replace the existing folder cache stuff with much simplerDan Winship2001-02-104-72/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-store.c: Rewrite a bunch. Replace the existing folder cache stuff with much simpler code that still handles all the existing cases. Now the folder hash table is always created by the base class, using hash and compare functions provided by the class implementation. (If they are set to NULL, CamelStore won't cache folders.) lookup_folder, cache_folder, and uncache_folder are no longer class methods, and get_name is gone completely. (camel_store_get_inbox): Renamed from camel_store_get_default_folder, since that wasn't being used, and this is what we actually need. (camel_store_get_root_folder): Removed, since it's not needed for anything given get_folder_info. * camel-remote-store.c: * providers/local/camel-local-store.c: * providers/local/camel-mbox-store.c: * providers/local/camel-mh-store.c: * providers/local/camel-maildir-store.c: * providers/nntp/camel-nntp-store.c: * providers/pop3/camel-pop3-store.c: * providers/vee/camel-vee-store.c: Minor updates for CamelStore changes * providers/imap/camel-imap-store.c (camel_imap_store_class_init): Update for CamelStore changes. (hash_folder_name, compare_folder_name): treat INBOX case-insensitively, otherwise use g_str_hash and g_str_equal. * camel-service.c (camel_service_construct): Remove camel_service_new and create camel_service_construct (as a class method) in its place. * camel-session.c (camel_session_get_service): Use camel_object_new and camel_service_construct to replace camel_service_new. * providers/local/camel-local-store.c (construct): Append a '/' to the URL path if it doesn't end with one svn path=/trunk/; revision=8145
* Changed to push the operation into a status stack.Not Zed2001-02-081-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | 2001-02-07 Not Zed <NotZed@Ximian.com> * camel-operation.c (camel_operation_start): Changed to push the operation into a status stack. (camel_operation_progress): Changed to only accept % complete. (camel_operation_reset): Free status stack as well. * providers/pop3/camel-pop3-folder.c (pop3_get_message): Get the octect count from the return line, and pass it to get_additional_data(). (pop3_refresh_info): Added status stuff. * providers/pop3/camel-pop3-store.c (camel_pop3_command_get_additional_data): Added a total bytes expected argument for progress reporting & fixed callers. (camel_pop3_command_get_additional_data): Added progress reporting. * providers/local/camel-mbox-summary.c (mbox_summary_sync_full): (mbox_summary_sync_quick): (summary_rebuild): Added progress reporting stuff. svn path=/trunk/; revision=8095
* Removed some debug 'warnings', as they should now be displayed at theNot Zed2001-01-231-4/+10
| | | | | | | | | | | | | | | | | | | | | 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
* Added profiling temp files.Not Zed2001-01-221-0/+4
| | | | | | | | | 2001-01-22 Not Zed <NotZed@Ximian.com> * .cvsignore */*/.cvsignore: Added profiling temp files. svn path=/trunk/; revision=7705
* Changed the descriptions for mh, mbox, and maildir to be moreJeffrey Stedfast2001-01-111-3/+3
| | | | | | | | | 2001-01-10 Jeffrey Stedfast <fejj@helixcode.com> * providers/local/camel-local-provider.c: Changed the descriptions for mh, mbox, and maildir to be more "user-friendly". svn path=/trunk/; revision=7373
* Lock the command channel while searching. (imap_body_contains): IfNot Zed2000-12-2411-414/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* change a bunch of IS_CAMEL_* macros to CAMEL_IS_*Dan Winship2000-12-1412-12/+12
| | | | | | | * Namespace cleanup: change a bunch of IS_CAMEL_* macros to CAMEL_IS_* svn path=/trunk/; revision=6972
* Hrm, we actually want to call set_header, not add_header here, probablyNot Zed2000-12-111-4/+34
| | | | | | | | | | | | | | | | | | | | | 2000-12-11 Not Zed <NotZed@HelixCode.com> * camel-medium.c (camel_medium_set_header): Hrm, we actually want to call set_header, not add_header here, probably explains some duplicate X-Evolution headers i was trying to track down. Also changed the api to handle a NULL value == remove the header. * providers/local/camel-maildir-summary.c (maildir_summary_decode_x_evolution): Always return error, we dont use x-evolution for maildir. (maildir_summary_encode_x_evolution): Always return a NULL string, likewise. (maildir_summary_add): Hook in here, since the _new function doesn't have access to any flags from the caller. If we have flags, then update the filename again. Not ideal, but should work. svn path=/trunk/; revision=6897
* Fix the check for "flags aren't actually changing".Dan Winship2000-12-061-3/+12
| | | | | | | | | | | | | | | * 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
* stream_flush does make sense for a substream afterall (if you have aNot Zed2000-12-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-12-05 Not Zed <NotZed@HelixCode.com> * camel-seekable-substream.c (stream_flush): stream_flush does make sense for a substream afterall (if you have a stream_write). (stream_write): Implement this. (stream_seek): Change the STREAM_END behaviour to be more sane. if bounded go from the end of the bound, if unbounded, go from the end of the parent stream. * camel-stream-mem.c (stream_read): Dont return error if reading past the end of data, just return 0. * camel-stream-fs.c (camel_stream_fs_init): Initialise the stream to be unbound. (stream_seek): Fix the logic when seeking from the end of an unbounded stream. (camel_stream_fs_new_with_fd): If the fd is invalid (-1), then return NULL immediately. (stream_seek): Range check a SEEK_END so it fits within bound_start. 2000-12-01 Not Zed <NotZed@HelixCode.com> * tests/lib/folders.c (test_folder_basic): New test to perform basic store operations on folders (taken from folders/test1). (test_folder_message_ops): Tkane the guts out of folders/test2. svn path=/trunk/; revision=6790
* Remove assertion that content is there, when it no longer can be.Not Zed2000-11-3010-69/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a missed unref.Not Zed2000-11-296-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-29 Not Zed <NotZed@HelixCode.com> * tests/message/test2.c (main): Add a missed unref. * camel-stream-mem.c (camel_stream_mem_set_buffer): We must set ourselves as the owner of the byte-array. Weird, someone has modified this file (its been reindented), but i can't see any changelogs ... * tests/lib/messages.c (content_finalise): Fix memleak in tester, free byte array when our content object is deleted. * camel-folder-search.c (camel_folder_search_finalize): Yeah great, so the sexp is a gtk object, not a camel object. Isn't that going to be fun to fix? * camel-session.c (camel_session_finalise): Free the storage path. * providers/local/camel-local-store.c (camel_local_store_init): If store->folders is setup, free it first, then overwrite. Hmm, this seems a bit crappy to me. * camel-store.c (camel_store_init): Dont setup store->folders if its already setup. * camel-exception.c (camel_exception_setv): Removed a memleak. no need to strdup after a strdup_printf!!! * camel-address.c (camel_address_finalize): Free the address ptrarray, once finished. * providers/local/camel-local-folder.c (local_finalize): Make sure we dont leave the folder locked on close. (local_finalize): Free summary/search. * providers/local/camel-mh-summary.c (mh_summary_next_uid_string): Small memleak, always free name after using it. * camel-mime-part.c (set_content_object): Free txt after setting the header. * providers/local/camel-maildir-summary.c (maildir_summary_check): Fix a memleak, close the dir after scanning new. (message_info_free): Added so we can free the filename cached in the messageinfo. (camel_maildir_summary_finalise): Free the hostname. * tests/folder/test[12].c (main): Clear out camel-test before starting. * providers/local/camel-mbox-summary.c (mbox_summary_sync_quick): Because encode_x_evolution folds the line (sigh, because encode_param does, unlike every other function in camel-mime-utils), unfold the encoded result before comparing. (mbox_summary_sync_quick): Another small memleak, free xevnew once finished with it. * camel-mime-utils.c (header_decode_quoted_string): Removed a redundant check for c=0. (header_unfold): New function to un-fold headers. * providers/local/camel-local-summary.c (local_summary_encode_x_evolution): some problems with encoding tags, using the wrong output strings. (local_summary_encode_x_evolution): We dont need to append a ; either, param_list_format_append() will do it for us. ` svn path=/trunk/; revision=6711
* Set the info size's properly, oops!Not Zed2000-11-289-51/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-28 Not Zed <NotZed@HelixCode.com> * providers/local/camel-maildir-summary.c (camel_maildir_summary_init): Set the info size's properly, oops! * tests/lib/folders.[ch]: Folder testing helpers. * tests/folder/test2.c: Test basic message ops on folders. * tests/folder/test1.c (main): Test basic folder ops on (local) stores. * providers/local/camel-local-provider.c (camel_provider_module_init): Removed some debug. * providers/local/camel-maildir-folder.c (camel_maildir_folder_class_init): fix parent class. * providers/local/camel-mh-folder.c (camel_mh_folder_class_init): Fix parent class (damn cut & paste). * providers/local/camel-maildir-store.c (get_folder): Call parent impl. (camel_maildir_store_class_init): Fix parent class setup. (delete_folder): Check the folder exists before trying to delete it. (delete_folder): Try and make the delete operation atomic/rollback failures. e.g. if one directory isn't empty, then create the other empty ones back. Also clear the tmp directory fully first. * providers/local/camel-mbox-store.c (get_folder): Call parent impl. (camel_mbox_store_class_init): parent class is camel_local_store, not camel_folder, oops. (delete_folder): Return an error if it doesn't exist, rather than covering it up. * providers/local/camel-mh-store.c (get_folder): Call parent impl. (camel_mh_store_class_init): fix parent class setup. (delete_folder): Error if it doesn't exist now. * camel-folder.c (camel_folder_move_message_to): (camel_folder_copy_message_to): Added warnings as these functions are going to be removed later. * camel-store.c (camel_store_get_root_folder): Fix for an early api change. We want CAMEL_STORE_FOLDER_CREATE, not TRUE, since its a flag. (camel_store_get_default_folder): And here too. * providers/local/camel-local-store.c (xrename): Handle renaming folders differently to renaming files. (get_default_folder_name): local stores dont have a default folder, so make it so. Or at least, it doesn't seem to make sense to have one. (get_root_folder_name): Same for root. (get_folder): Added parent implementation, that makes sure the service path exists, if we are creating a new folder (but doesn't create the folder). 2000-11-27 Not Zed <NotZed@HelixCode.com> * providers/local/camel-local-store.c (xrename): Fixed races. Use link/unlink, rather than rename, to properly detect overwriting another file. And allow some files to be missing. * providers/Makefile.am: Removed mh, mbox, added local, to the default. svn path=/trunk/; revision=6693
* add scan = scan->next; to avoid infinite loopRadek Doulik2000-11-281-0/+1
| | | | | | | | | | 2000-11-28 Radek Doulik <rodo@helixcode.com> * providers/local/camel-local-summary.c (local_summary_decode_x_evolution): add scan = scan->next; to avoid infinite loop svn path=/trunk/; revision=6690
* Remove "complete" fieldJP Rosevear2000-11-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-27 JP Rosevear <jpr@helixcode.com> * conduit/address-conduit.h: Remove "complete" field * conduit/address-conduit.c (print_local): Make it print useful debug info (print_remote): ditto (local_record_from_ecard): Make sure phone numbers get out to the pilot (ecard_from_remote_record): Set phone strings to "" if they are null (sequence_complete): unref the book view (view_cb): ref the book view (free_prepare): do nothing * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free): Destroy the card lists with the rest of the view. (pas_backend_file_changes): Don't destroy the card lists here (pas_backend_file_book_view_free): Free the card/id lists in the change context here, the correct place. (pas_backend_file_changes): instead of here... 2000-11-27 JP Rosevear <jpr@helixcode.com> * conduits/todo/todo-conduit.c (free_prepare): Ditto * conduits/calendar/calendar-conduit.c (free_prepare): Adjust free_prepare to the correct signal parameters. Don't actually do anything - there is a semantic discrepancy that needs to be resolved. 2000-11-27 JP Rosevear <jpr@helixcode.com> * providers/local/.cvsignore: shush svn path=/trunk/; revision=6681
* Shite, -1 on error, >=0 on success. So i've just been truncating all theNot Zed2000-11-211-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-21 Not Zed <NotZed@HelixCode.com> * providers/local/camel-mh-summary.c (mh_summary_sync_message): Shite, -1 on error, >=0 on success. So i've just been truncating all the messages I touched, good one zed. (mh_summary_sync_message): Sigh, and write to the right damn fd as well. (mh_summary_sync_message): Argh, and we need to compare the length of the old xev -1 to the new xev, to check if we can optimise it. * camel-folder.c (camel_folder_change_info_new): Init the pool. (camel_folder_change_info_add_source): Allocate string in the pool. (camel_folder_change_info_add_source_list): (camel_folder_change_info_add_update): No longer free the key, as it cannot be yet. (change_info_add_uid): Add a new arg, copy, telling it whether to copy the uid argument or not, and copy using mempool_strdup. (change_info_cat): Tell add_uid to copy the string. (camel_folder_change_info_add_update): Call add_uid directly. (change_info_remove): Call add_uid directly, with no copy, and dont free the key. (change_info_free_update): No longer required since we dont malloc the keys. (camel_folder_change_info_add_uid): Fix for add_uid change. (camel_folder_change_info_remove_uid): (camel_folder_change_info_change_uid): (change_info_clear): No longer needed, just set the size to 0 on the array directly. (camel_folder_change_info_clear): Empty the arrays directly, and flush the mempool too, and also clear uid_source, incase anyone was silly enough to call us in the wrong order. (camel_folder_change_info_free): Dont bother clearing the array's contents, just free the pool and throw away all the indexes. * camel-folder.h: Added a mempool to CamelFolderChangeInfo to store the uid's we get. * camel-folder-search.c (search_match_all): If we are only matching a single info, just use that/do the search. (camel_folder_search_match_expression): New function. Matches a single message info against an expression. (camel_folder_search_init): Init a hash table used to map the returned gptrarrays' to mempools. (camel_folder_search_execute_expression): Store all of the string data in a mempool, slightly faster, less wasted space (usually),. (camel_folder_search_free_result): Check for the mempool that stores the data for the list, and free that if we have it, otherwise assume we need to use g_free() (which should only happen if the list is empty at the moment). : commented out the debugging prints. Got sick of 'executing header search' crap. * providers/vee/camel-vee-folder.c (camel_vee_folder_init): Init changes. (camel_vee_folder_finalise): Free changes. (vfolder_add_match): Simple helper to add a new matching info record. (camel_vee_folder_add_folder): Only trigger a changed event if we have changes. (vfolder_change_match): New function, changes our local vfolder info to match the source. (vfolder_add_match): Add a new info to the vfolder list. (vfolder_remove_match): Remove a no-longer matching info from the vfolder summary. (message_changed): check if the message still matches, and remove/etc as required. (camel_vee_folder_finalise, init): init/free search object. (vee_folder_build_folder): Build the changes to the folder into the changes data, as we go. (folder_changed): If the folder gave us an explicit list of changes, then process each one separately (unless there's a lot added/changed). * providers/vee/camel-vee-folder.h: Added a changes field to the folder. svn path=/trunk/; revision=6628
* Fixes for the summary messageid changes. Hash the messageid and store it.Not Zed2000-11-217-341/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* We should always terminate the string. No need to check outptr is inNot Zed2000-11-172-7/+4
| | | | | | | | | | | | | | | | | | 2000-11-17 Not Zed <NotZed@HelixCode.com> * camel-stream-buffer.c (camel_stream_buffer_gets): We should always terminate the string. No need to check outptr is in range, its already been checked. * providers/local/camel-mbox-summary.c (mbox_summary_sync): When we update the summary, do it from mbox_summary->folder_size, not the content info endpos (which isn't any good anymore anyway). * providers/local/camel-mbox-folder.c (mbox_append_message): Set the frompos from the current folder size, since summary_add wont have initialised it to anything useful. svn path=/trunk/; revision=6597
* Check the uid string is all digits before trying to write a 'standard'Not Zed2000-11-169-230/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-16 Not Zed <NotZed@HelixCode.com> * providers/local/camel-local-summary.c (local_summary_encode_x_evolution): Check the uid string is all digits before trying to write a 'standard' x-ev header. * providers/local/camel-maildir-summary.c (camel_maildir_summary_info_to_name): Convert an info into a maildir name:info filename. (camel_maildir_summary_name_to_info): Convert a name:info filename into an info, and tell us if it didn't match it. (message_info_new): When creating a new filename, gets its info from the flags field. Likewise if creating from an existing file, extract the flags. (maildir_summary_sync): Remove a small memleak. Also, if our flags and that requires a filename change, perform that here. (message_info_new): Get the received date from the filename. Also, dont overwirte the uid if we have one. (maildir_summary_check): Sort the summary in received order before completion. (maildir_summary_next_uid_string): Test the name for collusions before we give it out. Retry, and if that fails, well, I guess we collide :( * providers/local/camel-mbox-folder.c (mbox_lock): Implement mbox locking. (mbox_unlock): And unlocking. (mbox_append_message): Lock the folder for write before doing anything. (mbox_get_message): Lock the folder for read before doing anything. * providers/local/camel-local-folder.c (camel_local_folder_lock): Implement something here. We handle the recursive ability but pass the locking to the folder itself. (camel_local_folder_unlock): Likewise for unlocking. (local_lock): Default - do nothing, return success. (local_unlock): Same. (local_sync): Changed slightly for locking api changes, and also, only lock around the sync process itself. * camel-lock.c: New file - utility functions for locking using different strategies and/or for locking folders safely. * Makefile.am (libcamel_la_SOURCES): Adde camel-lock.[ch] svn path=/trunk/; revision=6592
* New file - utility functions for locking using different strategies and/orNot Zed2000-11-161-4/+1
| | | | | | | | | | | 2000-11-16 Not Zed <NotZed@HelixCode.com> * camel-lock.c: New file - utility functions for locking using different strategies and/or for locking folders safely. * Makefile.am (libcamel_la_SOURCES): Adde camel-lock.[ch] svn path=/trunk/; revision=6590
* Maildir lives.Michael Zucci2000-11-1513-17/+1005
| | | | svn path=/trunk/; revision=6576
* Initial cut for local provider, to handle mh/mailbox/maildir atMichael Zucci2000-11-1522-0/+4165
least. Checking in to make a backup. svn path=/trunk/; revision=6575