Commit Graph

18 Commits

Author SHA1 Message Date
c3448c0b5a The flags'n'tags copy was unnecessary. Removed it.
2002-07-26  Peter Williams  <peterw@ximian.com>

	* providers/imap/camel-imap-summary.c
	(camel_imap_summary_add_offline_uncached): The flags'n'tags
	copy was unnecessary. Removed it.

svn path=/trunk/; revision=17607
2002-07-26 17:21:23 +00:00
4f17d5a3cb Prototype.
2002-07-25  Peter Williams  <peterw@ximian.com>

	* providers/imap/camel-imap-summary.h
	(camel_imap_summary_add_offline_uncached): Prototype.

	* providers/imap/camel-imap-summary.c
	(camel_imap_summary_add_offline_uncached): New function to add an
	uncached message to the summary while offline.

	* providers/imap/camel-imap-store.c (imap_connect_online): Only
	refresh the folders if the disco diary is empty (ie, we're not
	resyncing.)

	* providers/imap/camel-imap-folder.c (imap_transfer_offline): Emit
	an event for the source if deleting its originals. Also, if we
	can't load the message, still process it, using the new imap
	summary function.

svn path=/trunk/; revision=17596
2002-07-25 22:51:58 +00:00
4655d88867 Check for LOGIN xxxx as well if debug is on, so we dont print passwords to
2002-05-07  Not Zed  <NotZed@Ximian.com>

        * camel-remote-store.c (remote_send_string): Check for LOGIN xxxx
        as well if debug is on, so we dont print passwords to evolution
        logs.

        * providers/imap/camel-imap-utils.c (imap_is_atom_char): This was
        really broken.  1. isprint() is locale dependent, and 2. it looked
        up an 8 bit value in a 7 bit table without truncating it.  I've
        removed the isprint() stuff and just put it directly into the
        special table, which i've expanded to the right size too.

        * providers/imap/*: Applied patch from Preston Elder
        <prez@magick.tm> to make camel only use literals if it needs to
        for simple strings.  Changed slightly to use imap_is_atom() and
        more consistent formatting.
        providers/imap/camel-imap-utils.c (imap_is_atom): Chagned from
        imap_needs_quoting().

        ** Merged in camel-object2 branch.  Simpler camelobject
        implementation + object args interface.

        * camel.c (camel_init): Call camel_object_get_type() to make sure
        camel_object_type is initialised.

        * camel-object.h (CAMEL_OBJECT_TYPE): Changed to return global
        camel_object_type pointer, not call camel_object_get_type.

svn path=/trunk/; revision=16701
2002-05-07 07:31:26 +00:00
4ca07463a0 More fixing of the license texts.
svn path=/trunk/; revision=14217
2001-10-27 18:21:05 +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
43795a43b5 Create a CamelDiscoDiary. (imap_disconnect_offline): And free it.
* providers/imap/camel-imap-store.c (imap_connect_online,
	imap_connect_offline): Create a CamelDiscoDiary.
	(imap_disconnect_offline): And free it.

	* providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
	If RESYNCING, don't do any sort of checking that the remote folder
	matches the summary, beyond making sure that the UIDVALIDITY is
	correct.
	(imap_rescan): Add a missing camel_folder_summary_info_free when
	removing a UID from the summary.
	(imap_expunge_uids_offline): Implement. Fairly simple.
	(imap_expunge_uids_resyncing): Implement. If the store supports
	UIDPLUS, we can just use imap_expunge_uids_online. If not, we need
	to temporarily undelete any messages marked deleted on the server
	that aren't supposed to get expunged.
	(imap_append_offline): Implement, using cache and summary
	operations, and triggering the folder_changed event by hand.
	(imap_append_resyncing): Implement. Redo imap_append_online a bit
	in the process to make them able to share more code.
	(imap_copy_offline): Implement.
	(imap_copy_online): Move parts of this out into a helper.
	(imap_copy_resyncing): Implement. In most cases this is just like
	imap_copy_online, but if you are copying a message that was itself
	copied or appended into the folder, and the server doesn't do
	UIDPLUS, it will be necessary to replace at least part of the copy
	operation with one or more appends.

	* providers/imap/camel-imap-command.c (imap_read_response): Don't
	record the current folder in the response when in RESYNCING mode.
	(This means that EXISTS and EXPUNGE responses won't be processed,
	which is needed because the summary may not match the folder at
	this point.)
	(imap_read_response): On error, call
	camel_imap_response_free_without_processing, not
	camel_imap_response_free.

	* providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Make
	this work better when operating on UIDs that aren't in the summary.

	* providers/imap/camel-imap-summary.c
	(camel_imap_summary_add_offline): New routine used by
	imap_append_offline and imap_copy_offline to create new summary
	entries.

svn path=/trunk/; revision=10041
2001-05-29 17:09:12 +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
fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
fbb7448b5e Function to check if the store is online and set an exception if not.
* providers/imap/camel-imap-store.c
	(camel_imap_store_check_online): Function to check if the store is
	online and set an exception if not. Currently controlled by an
	environment variable, but eventually there will be both a global
	(session-level) setting and a per-store setting.
	(construct): Set up storage_path and base_url here rather than at
	connect-time.
	(imap_auth_loop): Split out from imap_connect.
	(imap_setup_online): Split out from imap_connect. Do the
	post-authentication connection setup, and cache the results to
	disk.
	(imap_setup_offline): Set up a CamelImapStore with information
	saved from a previous imap_setup_online.
	(imap_connect): If online, do connect_to_server(),
	imap_auth_loop(), and imap_setup_online(). Otherwise, do
	imap_setup_offline().
	(get_folder, get_folder_info): Add offline support.
	(create_folder, subscribe_folder, unsubscribe_folder): Disable
	these when offline (for now).

	* providers/imap/camel-imap-folder.c (camel_imap_folder_new):
	Remove the sync'ing-with-server stuff... it's done by
	camel_imap_folder_selected now, which only gets called if the
	store is online.
	(camel_imap_folder_selected): add the code removed from
	camel_imap_folder_new. Besides simplifying the folder_new and
	summary_new code, this also means now that we'll DTRT if a
	folder's UIDVALIDITY changes while we're connected. Also, when
	that happens, clear the message cache explicitly.
	(imap_refresh_info, imap_sync): These are no-ops when offline.
	(imap_expunge, imap_append_message, imap_copy_message_to,
	imap_search_by_expression): These don't yet work offline.
	(imap_get_message, camel_imap_folder_fetch_data): Return an error
	when trying to fetch a non-cached body part when we're offline.

	* providers/imap/camel-imap-summary.c (camel_imap_summary_new):
	Rewrite to not check the validity here. (We'll do it from
	camel_imap_folder_selected instead.)

	* providers/imap/camel-imap-command.c (camel_imap_command): Call
	camel_imap_folder_selected even when the selection is all we're
	doing, to match the changes in camel-imap-folder.c.

	* providers/imap/camel-imap-message-cache.c
	(camel_imap_message_cache_clear): New function to clear out a
	message cache.

svn path=/trunk/; revision=8851
2001-03-20 17:38:46 +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
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
fb91cdbd3a Add "guint32 server_flags" to CamelImapMessageInfo to keep track of the
* providers/imap/camel-imap-summary.c: Add "guint32 server_flags"
        to CamelImapMessageInfo to keep track of the last known message
        flag state on the server.
        (message_info_save, message_info_load): Save/load the
        server_flags.

        * providers/imap/camel-imap-folder.c: Make this use
        CamelFolderChangeInfo and emit folder_changed notifications as it
        gets them rather than only on refresh_info.
        (imap_refresh_info): Notice flags that get cleared on the server
        as well as flags that get set.
        (imap_update_summary): Remove a comment that never actually
        applied to the committed code.

svn path=/trunk/; revision=7086
2000-12-19 19:42:15 +00:00
2f1d55bd73 Handle the case where the summary failed to load - clear the summary and
2000-11-30  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/imap/camel-imap-summary.c (camel_imap_summary_new):
	Handle the case where the summary failed to load - clear the
	summary and then set the dirty bit so that it is sure to save
	later. Is this the right fix?

svn path=/trunk/; revision=6743
2000-11-30 21:15:09 +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
18dc66f594 Added code to expunge if called for (still need to finish coding this).
2000-06-16  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/imap/camel-imap-folder.c (imap_sync): Added code
	to expunge if called for (still need to finish coding this).
	(imap_get_uids): Implemented.
	(imap_get_summary): Found a way to get the date
	(imap_summary_get_by_uid): Same.
	(imap_free_summary): Implemented.

	* string-utils.c (strstrcase): Fixed a compile warning

	* providers/imap/camel-imap-summary.c: Removed - we don't
	need a CamelImapSummary structure.

svn path=/trunk/; revision=3606
2000-06-17 05:29:55 +00:00
c6f978717a providers/imap/camel-imap-summary.c now builds
svn path=/trunk/; revision=3470
2000-06-07 23:00:34 +00:00
02b3f2866a moved camel-imap-stream.* to providers/imap
added providers/imap/camel-imap-summary.c

svn path=/trunk/; revision=3456
2000-06-07 00:37:10 +00:00