Commit Graph

96 Commits

Author SHA1 Message Date
e1fa571225 Don't #include camel-mime-filter-save.h, we don't use it.
2002-02-27  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.h: Don't #include camel-mime-filter-save.h,
	we don't use it.

	* camel-file-utils.c: Fixed a few 'might be used uninitialized'
	warnings which were real problems.

	* camel-mime-part-utils.c
	(camel_mime_part_construct_content_from_parser): Save the raw mime
	stream for any/all signed parts.

	* camel-mime-part.c (camel_mime_part_init): Initialize our raw
	stream to NULL.
	(camel_mime_part_finalize): Unref our raw stream, if we have one.
	(write_to_stream): If we have a raw stream, write that out instead
	of re-encoding.

	* camel-mime-filter-save.[c,h]: Rewritten to save to a stream
	rather than a file.

svn path=/trunk/; revision=15867
2002-02-28 02:28:12 +00:00
eda028e5a5 Remove the CAMEL_MESSAGE_NEEDS_REPLY flag, we no longer will be using
2002-02-06  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.h: Remove the CAMEL_MESSAGE_NEEDS_REPLY
	flag, we no longer will be using this.

svn path=/trunk/; revision=15586
2002-02-07 00:42:30 +00:00
bd788027df If we don't want to corrupt the uuencoded data by overwriting it with
2002-01-16  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-filter-basic.c (filter): If we don't want to corrupt
	the uuencoded data by overwriting it with base64 decoded data
	afterward, we need to add a break statement!

	* camel-folder-summary.c (summary_build_content_info): Add code to
	add a uu filter.
	(camel_folder_summary_finalize): Unref the uuencode filter.

svn path=/trunk/; revision=15347
2002-01-16 23:38:32 +00:00
ffa73cbd5c Don't try setting a content-type parameter if either the name or value is
2001-12-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.c (content_info_load): Don't try setting a
	content-type parameter if either the name or value is NULL.

	* camel-mime-utils.c (header_set_param): NULL-protection.

svn path=/trunk/; revision=15248
2002-01-04 22:20:29 +00:00
b5e7713c8e Implements marking messages as "Need Reply".
Implements marking messages as "Need Reply".

2001-12-09  Jon Trowbridge  <trow@ximian.com>

	* mail-need-reply.xpm: Added a really, really ugly and
	awful icon to symbolize "message needs a reply".

	* Makefile.am (EXTRA_DIST): Added mail-need-reply.xpm.

2001-12-09  Jon Trowbridge  <trow@ximian.com>

	* camel-folder-summary.c: Add "NeedsReply" to the flag_names array
	for CAMEL_MESSAGE_NEEDS_REPLY.

	* camel-folder-summary.h: Added CAMEL_MESSAGE_NEEDS_REPLY flag.

2001-12-09  Jon Trowbridge  <trow@ximian.com>

	* vfoldertypes.xml: Add "Needs Reply" option to different status
	types.

	* filtertypes.xml: Add "Needs Reply" option to different status
	types.

2001-12-09  Jon Trowbridge  <trow@ximian.com>

	* message-list.c: #include "art/mail-need-reply.xpm".
	(ml_tree_value_at): Adjust magic numbers, show "Need Reply" icon
	if the message needs reply.
	(message_list_create_extras): Adjust magic numbers to add new
	icon.
	(on_click): Changed to toggle between unread, read, and need reply
	when the status icon is clicked.

	* mail-callbacks.c (mark_as_needing_reply): Added.
	(mark_as_not_needing_reply): Added.  Add "set" value to struct
	post_send_data.
	(composer_sent_cb): Use both "flags" and "set" elements of
	post_send_data when setting message flags.
	(mail_reply): Clear "Needs Reply" flag when we actually reply to a
	message.

	* folder-browser.c: Changed flag values to be given by
	bit-shifting (1<<5) vs. base-ten (32).  Added
	CAN_MARK_DOESNT_NEED_REPLY flag.  Added "Mark as Needing Reply"
	and "Mark as Not Needing Reply" elements to context menu.
	(on_right_click): Hide "Mark as (Not) Needing Reply" context menu
	elements as appropriate.

svn path=/trunk/; revision=14946
2001-12-10 03:50:36 +00:00
4
aa0a82422b Use the uid rather than vuid for unmatched. Also add the uid to unmatched
2001-11-14    <NotZed@Ximian.com>

        * camel-vee-folder.c (folder_changed_remove_uid): Use the uid
        rather than vuid for unmatched.  Also add the uid to unmatched if
        it wasn't in the unmatched_uids table at all.
        (folder_changed_change): If checking for added, if the new ones
        dont match, then try to add them to unmatched.  Fixes #6893.

        * camel-folder-summary.c (camel_folder_summary_index): Change lock
        order, always summary_lock before ref_lock.
        (camel_folder_summary_array): "
        (camel_folder_summary_uid): "
        (camel_folder_summary_remove_uid): "  Fixes a deadlock.

svn path=/trunk/; revision=14831
2001-11-30 21:38:05 +00:00
4ca07463a0 More fixing of the license texts.
svn path=/trunk/; revision=14217
2001-10-27 18:21:05 +00:00
1
a5fa3f992d Removed charset/locale charset lookup and iconv_open/close functions,
2001-10-11    <NotZed@Ximian.com>

        * camel-charset-map.[ch]: Removed charset/locale charset lookup
        and iconv_open/close functions, moved to gal.  Fixed all callers.

svn path=/trunk/; revision=13602
2001-10-11 22:08:20 +00:00
9
d5e090651b Implement.
2001-10-09    <NotZed@Ximian.com>

        * providers/local/camel-spool-folder.c (spool_search_by_uids):
        Implement.

        * providers/imap/camel-imap-search.c (imap_body_contains): If
        searching a sub-set of the total message count, then use a UID
        range to search only specific messages.

        * camel-vee-folder.c (vee_folder_change_match): Removed.
        (folder_changed_add_uid): Helper func for changed code.
        (folder_changed_remove_uid): "
        (folder_changed_change_uid): "
        (folder_changed): Rewritten.  Supports proper auto-updating of
        changes, but not removals till a sync occurs.
        (vee_search_by_uids): Implement.
        (folder_changed): Changed to call an async threaded function to do
        the actual folder updating.

        * camel-folder-summary.c (camel_flag_list_copy): New func to copy
        a whole list of flags.
        (camel_tag_list_copy): New func to copy a whole list of flags.

        * providers/imap/camel-imap-folder.c (imap_search_by_uids):
        Implement.

        * providers/local/camel-local-folder.c (local_search_by_uids):
        Implement.

        * camel-folder.c (camel_folder_search_by_uids): New function,
        search a subset of uid's.
        (search_by_uids): Default impl, return error.

svn path=/trunk/; revision=13532
2001-10-09 22:26:01 +00:00
4
450e955e76 If the type is encoded, get the fallback charset from the message
2001-09-24    <NotZed@Ximian.com>

        * camel-filter-search.c (check_header): If the type is encoded,
        get the fallback charset from the message content-type.

        * camel-mime-part-utils.c (check_html_charset): Dont check for
        charset==null before calling charset_to_iconv.
        (simple_data_wrapper_construct_from_parser): "

        * camel-mime-message.c (process_header): Try use content-type
        charset param as the fallback charset.

        * camel-charset-map.c (camel_charset_to_iconv): Handle name ==
        NULL, return NULL.

        * camel-folder-summary.c (camel_folder_summary_format_address):
        (camel_folder_summary_format_string): Made private again, removed
        #warning about it.  Renamed to s/camel_folder//.
        (summary_format_string): Take default charset param.
        (camel_message_info_new_from_header, message_info_new): Decode
        content-type field to get the charset parameter to use as the
        default charset for decoding strings.

        * camel-search-private.c (camel_search_header_match): Pass NULL as
        the charset, the locale charset is always tried.
        (camel_search_header_match): Supply a default_charset parameter to
        be used with TYPE_ENCODED params.

        * camel-mime-utils.c
        (header_param): get rid of the g_strcasecmp crap.
        (header_set_param): Same here.
        (header_decode_param_list): And here.
        (header_decode_text): Totally rewritten.  30% of its size.  If the
        word is not rfc2047 encoded, always try default_charset if
        supplied, if that fails, try locale charset if it exists, if that
        fails then assume latin1/7 bit ascii.
        (append_8bit): Changed to return FALSE if we can't convert for
        whatever reason, and dont append anything.

        * camel-mime-part.h (struct _CamelMimePart): Move content_type and
        headers out of the 'private' section.

        * camel-mime-part.c (get_headers): Dont do any conversion on the
        header.
        (process_header): Get the content-type charset as the fallback
        charset for decode_string.
        (construct_from_parser): IF we have a content-type header, process
        it before doing anything else, so we have access to a fallback
        charset for invalid headers.

svn path=/trunk/; revision=13096
2001-09-24 19:31:07 +00:00
7d17dc2230 New function to just load the summary. Not much use yet, until unread
* camel-folder-summary.c (camel_folder_summary_header_load): New
	function to just load the summary.  Not much use yet, until unread
	counts are stored in the summary (which now looks like too much
	work!).

	* camel-mime-utils.c (header_decode_mailbox): Crappy fix for
	stupid mailers.  If we get 'name b. name <foo>' then treat it as
	'"name b. name" <foo>'.  See 8147.
	(header_decode_mailbox): Another fix for really broken mailers
	that have things that look like addresses followed by <address>
	bits.
	(rfc2047_encode_word): Escape ??= to avoid some bizarre warning
	about trigraphs.

	(scan_dir): If we dont have the folder open, then scan the 'new'
	and 'cur' folders for new and unread messages to count instead.

svn path=/trunk/; revision=13040
2001-09-21 03:05:03 +00:00
25ea76f3a7 Convert to the iconv-friendly charset names.
2001-07-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-filter-charset.c
	(camel_mime_filter_charset_new_convert): Convert to the
	iconv-friendly charset names.

	* providers/imap/camel-imap-store.c (create_folder): Fixed a
	compiler warning about returning without a value in a non-void
	function. Blah.

	* camel-mime-part.c (process_header): Pass the locale charset as
	the default_charset to header_decode_string().

	* camel-folder-summary.c (camel_folder_summary_format_string):
	Pass the locale charset as the default_charset to
	header_decode_string().
	(content_info_new): Same.

	* camel-mime-message.c (process_header): Pass the locale charset
	as the default_charset to header_decode_string().

	* camel-mime-utils.c (append_8bit): New helper function who's
	purpose is similar to append_latin1() but for 8bit text that we
	are assuming is not latin1.
	(header_decode_text): Now takes a default_charset parameter and
	calls append_8bit when appropriate.
	(header_decode_string): Also takes a default_charset parameter
	now.
	(header_decode_mailbox): Pass NULL as the default_charset to
	header_decode_string().

svn path=/trunk/; revision=11250
2001-07-20 00:08:50 +00:00
05e4067b62 Removed some code i wasn't supposed to commit.
2001-07-12  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c
        (camel_folder_summary_info_new_from_message): Removed some code i
        wasn't supposed to commit.

        * providers/local/camel-local-summary.c (local_summary_add): Only
        set info->size if it is not zero.
        (local_summary_add): If we dont get a size from the info passed
        in, calculate it using a null stream write.  Should do #4392.

svn path=/trunk/; revision=11025
2001-07-12 02:22:23 +00:00
96496c1392 Create the messageinfo itself, so we can properly set the size.
2001-07-11  Not Zed  <NotZed@Ximian.com>

        * camel-filter-driver.c (camel_filter_driver_filter_mbox): Create
        the messageinfo itself, so we can properly set the size.

        * camel-movemail.c (camel_movemail_solaris): Write out the from
        line between each message.

2001-07-10  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-local-summary.c (local_summary_add): Copy
        the size across from the source message info if supplied.

        * camel-stream-null.c: Added a 'written' member which keeps track
        of how much has been written to the stream.

        * camel-movemail.c (camel_movemail): If we have BROKEN_SPOOL
        defined, then use the solaris movemail to quote from lines that
        sendmail didn't.
        (camel_movemail_solaris): Compile this in if BROKEN_SPOOL defined.

svn path=/trunk/; revision=10989
2001-07-11 07:28:40 +00:00
fec83fec7d Added an assert to make sure that `mi' isn't NULL.
2001-07-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.c (camel_message_info_string): Added an
	assert to make sure that `mi' isn't NULL.
	(camel_message_info_set_string): Same.

	* providers/imap/camel-imap-command.c (camel_imap_response_free):
	Create and use a temporary CamelException for use with
	camel_imap_folder_changed.

svn path=/trunk/; revision=10834
2001-07-05 22:59:46 +00:00
228991b317 (camel_message_info_dup_to): Assign the to->strings from the
e_poolv_cpy() call, since it may allocaote a new poolv if the
 	lengths do not match.

svn path=/trunk/; revision=10790
2001-07-05 09:38:59 +00:00
bf20209bbb When indexing a new record, create a pseudo word 'ibexindexed' so we can
2001-07-05  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c
        (camel_folder_summary_info_new_from_message): When indexing a new
        record, create a pseudo word 'ibexindexed' so we can always tell
        that a message has already been idnexed, even if it contains no
        words of its own.  Things like maildir use this check to see if
        its already been processed, and it matters if it is incorrect in
        this case (not just wasted cycles).

        (camel_folder_summary_info_new_from_parser): And same here.

        * providers/local/camel-maildir-summary.c (maildir_summary_sync):
        Changed the logicfor epoolv code to be different, we dont need to
        update hash references or any tricky stuff.
        (maildir_summary_check): Samehere.

        * camel-folder-summary.h: Removed include of e-memory.h.

svn path=/trunk/; revision=10785
2001-07-05 03:13:52 +00:00
7a68209879 re-enable html indexing.
2001-07-02  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c (summary_build_content_info): re-enable
        html indexing.

        * camel-mime-filter-html.c: Completely re-implemented using a
        custom parser.

svn path=/trunk/; revision=10676
2001-07-02 13:32:55 +00:00
91cc026904 Update the copyrights, replacing Helix Code with Ximian and
helixcode.com with ximian.com all over the place.

svn path=/trunk/; revision=10440
2001-06-23 08:52:02 +00:00
e905364bee Only create a missing uid if we have indexing turned on.
2001-06-18  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c
        (camel_folder_summary_info_new_from_parser): Only create a missing
        uid if we have indexing turned on.

        * camel-lock-helper.c (setup_process): Function to setup
        process/sanity/security checks.  Change to the real uid as soon as
        we can.
        (lock_path): First try to lock as the real uid, if that fails, try
        the root uid.
        (unlock_id): Unlock as the uid we created the lock as.

        * Makefile.am (INCLUDES): Added -DCAMEL_SBINDIR for lock helper
        location.

        * providers/local/camel-spool-folder.c (spool_lock): Implemented,
        using lock helper locking.  Need to work out if the locking
        requires a root created lock?
        (spool_unlock): Likewise.

2001-06-15  Not Zed  <NotZed@Ximian.com>

        * camel-lock-helper.c: Setuid Lock helper process.  Creates and manages
        .locks, keeping them active, removing them, etc.  What real perms it
        needs is a little system dependent.

2001-06-14  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-maildir-store.c (get_folder_info): Implement.
        (scan_dir): Does the work of scanning for maildir directories.

2001-06-13  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-spool-store.c (get_folder_info):
        Implemented, just returns a hardcoded INBOX folder.
        (free_folder_info): implemented, free's the 1 possible level of
        folder info.

        * providers/local/camel-spool-folder.c
        (camel_spool_folder_construct): Set the real unread message
        count on the folder_created thing.

svn path=/trunk/; revision=10261
2001-06-18 14:36:44 +00:00
84e075645b New file, with the int, string, time_t, and off_t encode/decode routines
* 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
2001-04-26 19:44:50 +00:00
7d9faeb00c Applied jacob's patches for e-poolv stuff.
2001-04-26  Not Zed  <NotZed@Ximian.com>

        * Applied jacob's patches for e-poolv stuff.

svn path=/trunk/; revision=9571
2001-04-26 01:09:05 +00:00
2ac5b884fe merge from evolution-0-10-branch to evolution-0-10-merge-0
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
2001-04-05 02:31:47 +00:00
f964f65b79 Unref the html filter when done. (summary_build_content_info): Disable
2001-03-27  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c (camel_folder_summary_finalize): Unref
        the html filter when done.
        (summary_build_content_info): Disable using the html parser to
        help index html mails until it gets sorted out.

svn path=/trunk/; revision=8975
2001-03-27 12:48:13 +00:00
1d80d46ed5 Added folder_created event here.
2001-03-27  Not Zed  <NotZed@Ximian.com>

        * camel-vee-store.c (vee_get_folder): Added folder_created event
        here.

        * camel-vee-folder.c (unmatched_finalise): Removed, moved into
        main finalise code.
        (message_changed): Just create a new change entry and promote it
        to a folder_changed thing.
        (vee_sync): Always rebuild folder on sync, even when not expunge.
        (folder_changed): If not autoupdating, make sure we remove any
        removed entries.
        (vee_folder_build_folder):
        (vee_folder_remove_folder): NOP if we're called on
        folder_unmatched.
        (vee_search_by_expression): Only search each folder once.  Should
        we also order the result in summary order?

2001-03-20  Not Zed  <NotZed@Ximian.com>

        * camel-store.c (init_trash): Fix calling for vee_folder_new().

        * camel-folder-summary.c (camel_folder_summary_remove_index):
        Optimise slightly, use ptr_array_remove_index rather than have to
        search for the index by using summary_remove.

        * camel-vee-folder.h: Removed local member from VeeFolder, since
        it was never used.

        * camel-vee-store.c (camel_vee_store_finalise): Setup finalise
        function.

        * camel-vee-folder.c (camel_vee_folder_set_expression): New
        function to set the query of an existing vfolder.
        (camel_vee_folder_construct): New function for
        convenience/subclasses.
        (camel_vee_folder_new): Removed exception parameter, no longer
        needed (since we dont search yet).
        (camel_vee_folder_new): Changed to use folder_construct, and no
        longer raise the folder created signal.
        (vee_folder_build_folder): Make it return error on exception, so
        we can work without exceptions.
        (vee_folder_remove_folder): Use remove index rather than
        remove_uid, this is ok since we have the summary locked for our
        own access.
        (camel_vee_folder_add_folder): Only add the folder to the
        unmatched private if it is not a private folder.
        (camel_vee_folder_remove_folder): Only remove the folder from
        unmatched if it is not private.
        (vee_expunge): Just call sync with expunge set.
        (vee_sync): If expunging, also refresh the search.
        (vee_folder_build_folder): We do our own locking now, removed from
        callers, also trigger changed events here too (within locks),
        fixed callers appropriately.
        (vee_folder_remove_folder): Do our own locking, and trigger
        changed events.
        (vee_folder_add_info): Renamed of vee_folder_add, we now take a
        hash of the folder name, rather than use the folders address.
        (hash_folder): Convert a folder name into an 8 character hash.
        (vee_get_message, vee_search_by_expression, vee_set_message_flags,
        vee_set_message_user_flag, vee_move_message_to): Changed the uid
        to be an 8 byte hash + original uid, with no ':' anymore.

svn path=/trunk/; revision=8957
2001-03-26 23:10:40 +00:00
0e9c0268a8 re-constify inbuf, to remove a warning.
2001-03-14  Not Zed  <NotZed@Ximian.com>

	* camel-mime-filter-charset.c (filter, complete): re-constify
	inbuf, to remove a warning.

	* camel-mime-parser.c (folder_scan_step): When we're out of data,
	run the filter_complete.  For some reason the logic that was there
	was never being run, always try it now, i think it was to work
	around a buggy filter, rather than fix it the right way.

	* camel-folder-summary.c (summary_build_content_info): If indexing
	html parts, use the html filter to convert it to some indexable
	format.
	(summary_build_content_info): Reset the filters before adding them
	back to the stream, if they get re-used in a given instance
	(likely).

	* Makefile.am (libcamelinclude_HEADERS): Added
	camel-mime-filter-html.[ch].
	(INCLUDES): Added xml clags

2001-03-05  Not Zed  <NotZed@Ximian.com>

	* camel-folder-search.c (camel_folder_search_class_init): Setup a
	new function, "uid" which matches uids.
	(search_uid): Implement the "match uid" command.

svn path=/trunk/; revision=8705
2001-03-14 07:06:54 +00:00
c13a70e866 Doh, cut and paste problem, use mlist not cc.
* camel-folder-summary.c (camel_message_info_new_from_header):
	Doh, cut and paste problem, use mlist not cc.

	* camel-folder.c (move_message_to):
	(copy_message_to): If the source folder doesn't support a
	summary, dont try and get the message info from it.

svn path=/trunk/; revision=8361
2001-02-23 01:40:46 +00:00
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