Commit Graph

69 Commits

Author SHA1 Message Date
72bc2233d2 Take the ^Header: part out of the expression, since we look that up
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
2001-02-20 00:19:16 +00:00
96be0c50f7 Removed some debug 'warnings', as they should now be displayed at the
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
2001-01-23 03:25:03 +00:00
d184f178b8 Add some g_warnings() to help debug later if I ever get the segfaults I
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
2001-01-18 02:49:29 +00:00
a37006af0a Make sure that the message-info is non-null before we go accessing inner
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
2001-01-18 02:03:04 +00:00
a57329a173 Add an int i so this code will compile. Should I be worried about how well
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
2001-01-17 02:14:17 +00:00
4f5effdf88 Index: ChangeLog
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
2001-01-17 01:07:02 +00:00
8ad855fef6 Delayed loading of IMAP message parts.
* 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
2001-01-17 00:27:19 +00:00
e3a451cb33 Chganged len back to be unsigned. And do a simple range check on the
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
2001-01-16 03:54:45 +00:00
156996ac5e Remove this. It was only a thin wrapper around struct _header_content_type
* 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
2000-12-28 19:28:39 +00:00
6de256c2a2 Lock the command channel while searching. (imap_body_contains): If
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
2000-12-24 00:46:20 +00:00
7b80470152 Added #ifndef NO_WARNINGS around a #warning. Added (void) to the prototype
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
2000-12-12 23:31:40 +00:00
8d4e508f40 Fix the check for "flags aren't actually changing".
* 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
2000-12-05 16:46:15 +00:00
787d1833c0 Added system_flag to CamelFolderSearchClass
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
2000-12-02 03:55:18 +00:00
c1d2ec0123 New convenience function, doesn't do much but it sure makes code cleaner
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
2000-12-01 00:34:33 +00:00
1fbfdbd43e Remove assertion that content is there, when it no longer can be.
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
2000-11-30 11:05:36 +00:00
854f94bc20 Fixes for the summary messageid changes. Hash the messageid and store it.
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
2000-11-20 23:54:48 +00:00
fb76cad79a Removed local again, not quite ready.
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
2000-11-15 06:33:49 +00:00
c70c4c35f3 Implement a complete() function, now we need one. (filter): Upgraded to
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
2000-11-07 12:31:10 +00:00
e81e64f8dd Simple subclass of CamelFolderSummary that also keeps a UIDVALIDITY value
* 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
2000-10-12 20:55:11 +00:00
6c337e9ea0 Removed temp_message_buffer, and content_input_stream fields which seem to
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
2000-10-12 13:38:51 +00:00
8681790bb9 Decode the resulting string.
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
2000-10-06 21:38:36 +00:00
47a2f8444f Handle the case where ct != NULL, but type and subtype are, and also match
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
2000-10-04 15:56:32 +00:00
e9dc30dbf0 Remove camel_folder_{get,free}_subfolder_info, as we want to be able to
* 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
2000-10-02 19:08:20 +00:00
e71de4c021 New function to fold headers.
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
2000-09-28 11:31:29 +00:00
0d2998b1a1 update CamelFolderInfo New function to free the contents of a
* 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
2000-09-17 17:13:57 +00:00
81f994a359 More UTF-8 handling
svn path=/trunk/; revision=5032
2000-08-25 04:31:13 +00:00
40eea3692e Fixed some warnings.
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
2000-08-11 02:57:11 +00:00
8cb514d6dd Merge with camel-async.
svn path=/trunk/; revision=4687
2000-08-10 17:30:50 +00:00
690509bf82 A better way to compress leading whitespace. The code is probably invalid
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
2000-08-10 16:35:28 +00:00
983c9f72a3 Oops, an unsigned integer can never be < 0
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
2000-07-11 00:02:17 +00:00
b104482c8f Cleaned up a bunch of compile warnings
2000-07-10  Jeffrey Stedfast  <fejj@helixcode.com>

	* camel-folder-summary.c: Cleaned up a bunch of compile warnings

svn path=/trunk/; revision=4055
2000-07-10 21:44:49 +00:00
90d51074c9 New function to copy a header_references structure.
* 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
2000-07-09 22:40:49 +00:00
941a7e5a30 Parse for more header information to allow message threading in IMAP.
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
2000-07-06 20:52:41 +00:00
9f381f8245 remove some non-error case debugging messages.
* remove some non-error case debugging messages.

svn path=/trunk/; revision=3904
2000-07-06 01:52:51 +00:00
0837fc4099 Fix the "clashing UIDs are not updated on disk" problem by syncing
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
2000-07-05 19:42:32 +00:00
a3c2c90d0a Add "Cc" to summary and bump summary version number.
* 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
2000-07-05 17:59:48 +00:00
6d76cc84a1 Centralize creation of new UIDs for the summary.
svn path=/trunk/; revision=3885
2000-07-04 03:40:58 +00:00
9bc397a131 Get rid of unused function `camel_folder_summary_set_uid()'.
svn path=/trunk/; revision=3882
2000-07-04 02:37:00 +00:00
a1d1e450a1 Parse In-Reply-To with header_references_decode, not header_msgid_decode.
* 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
2000-07-03 15:13:07 +00:00
242ffb8b8e Set date_received based on the first (most recent) "Received" header.
* camel-folder-summary.c (message_info_new): Set date_received
	based on the first (most recent) "Received" header.

svn path=/trunk/; revision=3677
2000-06-21 18:15:27 +00:00
b7f2532c93 mark the message info with CAMEL_MESSAGE_FOLDER_FLAGGED if we change the
* 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
2000-06-20 17:37:33 +00:00
174d7c38d1 Move flag handling from CamelMimeMessage to CamelFolder. This
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
2000-06-16 23:09:43 +00:00
f0600c2ccb KLUDGE! Since neither ETable nor GtkHTML supports UTF-8 yet, output
* 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
2000-06-16 22:42:12 +00:00
4cf5bbfa5a If we get a funny result, just throw it out. Basically a fix for the one
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
2000-06-02 18:09:18 +00:00
1ff07425c1 Guess!
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
2000-05-18 22:40:24 +00:00
879ec8920b Quick fix to get it to compile. I hope I don't get into trouble.
* 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
2000-05-17 23:40:47 +00:00
14bc1cbfc8 All this basically to support user flags in the summary. They are not yet
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
2000-05-17 19:24:24 +00:00
cb13084bc2 > * providers/mbox/camel-mbox-folder.c (message_changed): Indicate
> 	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
2000-05-11 20:46:13 +00:00
e17b3c90f4 Big bunch o memleaks fixed.
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
2000-05-11 18:39:53 +00:00
1
d91a0645f9 Free summary items and charset filters.
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
2000-05-11 17:05:04 +00:00