Commit Graph

66 Commits

Author SHA1 Message Date
7c553e6e5b new abstract class for disconnectable remote stores
* camel-disco-store.c: new abstract class for disconnectable
	remote stores

	* camel-disco-folder.c: new abstract class for folders on
	disconnectable stores.

	* Makefile.am: Add camel-disco-folder.[ch] and
	camel-disco-store.[ch].

	* providers/imap/camel-imap-store.c: Make this a subclass of
	CamelDiscoStore, and fix up the offline interfaces for the changes
	since they were first written (particularly the fact that some
	IMAP stores don't just use subscribed folders).

	* providers/imap/camel-imap-folder.c: Make this a subclass of
	CamelDiscoFolder, although most ops still fail in disconnected
	mode.

	* camel-store.c (camel_store_get_folder_info): Change gboolean,
	gboolean, gboolean to guint32 in the prototype for this function.

	* providers/local/camel-local-store.c (get_folder_info): Update
	for prototype change.

svn path=/trunk/; revision=9659
2001-05-03 20:52:59 +00:00
8cc3a0e4dc Remove the EXTRA_GNOME_CFLAGS include.
2001-04-16  Jeffrey Stedfast  <fejj@ximian.com>

	* Makefile.am: Remove the EXTRA_GNOME_CFLAGS include.

	* camel-store.c (camel_mkdir_hier): Convenience function that it
	seems a number of camel-store implementations used gal for.

	* providers/nntp/camel-nntp-store.c (ensure_news_dir_exists): Lets
	not depend on gal for just e_mkdir_hier() - use camel_mkdir_hier()
	instead.

	* providers/nntp/camel-imap-store.c: Lets not depend on gal for
	just e_mkdir_hier() - use camel_mkdir_hier() instead.

	* camel-session.c (camel_session_get_storage_path): Don't depend
	on e_mkdir_heir() anymore, use the CamelStore version.

	* camel-folder-search.h: Removed gal dependency, why was this even
	there in the first place?

	* providers/imap/camel-imap-folder.c: Don't need gal/util/e-util.h
	here, so remove it.

	* string-utils.c (strstrcase): New function, well more like old
	function brought back to life so we don't have to depend on gal.

	* providers/imap/camel-imap-store.c (imap_store_setup_online): Use
	strstrcase rather than e_strstrcase so we don't depend on gal.
	(get_unread_online): Same here.

	* providers/smtp/camel-smtp-transport.c (smtp_helo): Use
	strstrcase.

svn path=/trunk/; revision=9383
2001-04-16 17:09:38 +00:00
fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
efddd51d3b Use camel_vtrash_folder_new() to create the vtrash folder now.
2001-03-26  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (init_trash): Use camel_vtrash_folder_new() to
	create the vtrash folder now.

	* camel-vtrash-folder.[c,h]: New subclass of CamelVeeFolder for
	our vTrash folders.

	* camel-folder.c (camel_folder_copy_messages_to): Don't watch for
	vtrash folders anymore.
	(camel_folder_move_messages_to): Same.

	* camel-vee-folder.c (camel_vee_folder_class_init): Update.
	(vee_move_messages_to): Rewrite to use the new move API.

	* camel-filter-driver.c (do_copy): Updated to reflect
	copy_message_to changes. Create a temporary uid array and use
	that.
	(do_move): Same.
	(camel_filter_driver_filter_message): And again, here...

	* providers/imap/camel-imap-folder.c (imap_copy_messages_to):
	Update to the new API.
	(imap_move_messages_to): Same.
	(get_uid_set): New function to create a `set' string based on an
	array of UIDs for use with imap_copy_messages_to.

	* camel-folder.c (camel_folder_copy_messages_to): Replaces
	camel_folder_copy_message_to
	(camel_folder_move_message_to): Replaces
	camel_folder_move_message_to.

svn path=/trunk/; revision=8960
2001-03-27 01:41:21 +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
a5fa60b927 Rename the folder to "Trash" and i18nify it.
2001-03-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (init_trash): Rename the folder to "Trash" and
	i18nify it.

svn path=/trunk/; revision=8646
2001-03-12 20:33:58 +00:00
180b0898db Changes so that the folder gets added to the vtrash reguardless of whether
2001-03-08  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_get_folder): Changes so that the
	folder gets added to the vtrash reguardless of whether or not the
	store is holding it's own folder lookup hash.
	(init_trash): Oops, lets try locking the cache before we go and
	add all the cached folders to the vtrash.

svn path=/trunk/; revision=8609
2001-03-08 23:33:32 +00:00
e74803511e These fixes make it so that the CamelStore does not actually hold a ref on
2001-03-08  Jeffrey Stedfast  <fejj@ximian.com>
	These fixes make it so that the CamelStore does not actually hold
	a ref on it's vTrash folder. The vTrash folder is now created ONLY
	when it is requested. This solves the problem of not being able to
	unref a Store and have it disconnect/finalize like we expect it to.

	* camel-store.c (init_trash): When we create the vtrash, add all
	previously opened folders to it and hook on to the finalize event
	so that we can then set the store->vtrash to NULL.
	(get_trash): If a vtrash folder for the store doesn't exist,
	init_trash() and then try.
	(construct): No longer need this.
	(camel_store_class_init): Don't override the construct method.
	(camel_store_finalize): We no longer hold a ref on the vtrash so
	don't unref it.

svn path=/trunk/; revision=8595
2001-03-08 20:01:42 +00:00
0108c726f4 fixed a compile warning in camel-store.
svn path=/trunk/; revision=8382
2001-02-24 20:09:20 +00:00
585f905ecd init the vTrash folder here instead of in store_init.
2001-02-24  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (construct): init the vTrash folder here instead
	of in store_init.
	(camel_store_class_init): init service_class->construct.
	(camel_store_finalize): We only need to unref the vtrash folder.
	(init_trash): don't create a vstore since we don't need it.

svn path=/trunk/; revision=8378
2001-02-24 17:44:28 +00:00
afd1cad2da init get_trash and init_trash. (camel_store_init): call the virtual
2001-02-23  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_class_init): init get_trash and
	init_trash.
	(camel_store_init): call the virtual init_trash function.
	(camel_store_finalize): unref the vtrash folder/store if present.
	(camel_store_get_folder): Add the new folder to the vtrash
	vfolder.
	(init_trash): default implementation of init_trash.
	(get_trash): default implementation of get_trash.

	* camel-vee-store.c (vee_init_trash): No-op.
	(vee_get_trash): return NULL

svn path=/trunk/; revision=8368
2001-02-23 16:52:55 +00:00
f89ca302d1 Emit the folder_created signal here.
2001-02-15  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/vee/camel-vee-folder.c (camel_vee_folder_new): Emit
	the folder_created signal here.

	* providers/local/camel-local-folder.c
	(camel_local_folder_construct): Emit the folder_created signal.

	* providers/local/camel-local-store.c (delete_folder): On error,
	free the 'name' string so we don't leak. Also emit the
	folder_deleted signal.

	* providers/imap/camel-imap-store.c (subscribe_folder): Emit the
	folder_created signal.
	(unsubscribe_folder): Emit the folder_deleted signal.

	* camel-store.c (camel_store_class_init): Added folder_created and
	folder_deleted signal defs.

svn path=/trunk/; revision=8246
2001-02-15 19:20:38 +00:00
7d76ff5501 New method to create a folder when you don't know its full name.
* camel-store.c (camel_store_create_folder): New method to create
	a folder when you don't know its full name.

	* providers/imap/camel-imap-store.c (create_folder): Implement.

svn path=/trunk/; revision=8231
2001-02-14 21:51:33 +00:00
65eb577ecd Rewrite a bunch. Replace the existing folder cache stuff with much simpler
* camel-store.c: Rewrite a bunch. Replace the existing folder
	cache stuff with much simpler code that still handles all the
	existing cases. Now the folder hash table is always created by the
	base class, using hash and compare functions provided by the class
	implementation. (If they are set to NULL, CamelStore won't cache
	folders.) lookup_folder, cache_folder, and uncache_folder are no
	longer class methods, and get_name is gone completely.

	(camel_store_get_inbox): Renamed from
	camel_store_get_default_folder, since that wasn't being used, and
	this is what we actually need.
	(camel_store_get_root_folder): Removed, since it's not needed for
	anything given get_folder_info.

	* camel-remote-store.c:
	* providers/local/camel-local-store.c:
	* providers/local/camel-mbox-store.c:
	* providers/local/camel-mh-store.c:
	* providers/local/camel-maildir-store.c:
	* providers/nntp/camel-nntp-store.c:
	* providers/pop3/camel-pop3-store.c:
	* providers/vee/camel-vee-store.c: Minor updates for CamelStore
	changes

	* providers/imap/camel-imap-store.c (camel_imap_store_class_init):
	Update for CamelStore changes.
	(hash_folder_name, compare_folder_name): treat INBOX
	case-insensitively, otherwise use g_str_hash and g_str_equal.

	* camel-service.c (camel_service_construct): Remove
	camel_service_new and create camel_service_construct (as a class
	method) in its place.

	* camel-session.c (camel_session_get_service): Use
	camel_object_new and camel_service_construct to replace
	camel_service_new.

	* providers/local/camel-local-store.c (construct): Append a '/' to
	the URL path if it doesn't end with one

svn path=/trunk/; revision=8145
2001-02-09 16:43:22 +00:00
9c3295326a More tweaking... skip separator characters after the namespace character.
* camel-store.c (camel_folder_info_build): More tweaking... skip
	separator characters after the namespace character. (Gets rid of
	the shell folder registration warning some people have had with
	IMAP)

	* providers/imap/camel-imap-store.c (imap_connect): I'm sure there
	was some clever reason I was storing the flags of the folder in
	the hash table rather than just "1", but I don't remember what it
	was now. Anyway, since we only ever test NULL/non-NULL, store 1,
	since flags is sometimes 0.

svn path=/trunk/; revision=7628
2001-01-19 00:14:42 +00:00
54c085cc3c New class function, parallel to camel_folder_sync. (The default
* camel-store.c (camel_store_sync): New class function, parallel
	to camel_folder_sync. (The default implementation just calls
	camel_folder_sync on each cached folder.)

	* providers/imap/camel-imap-store.c (get_folder_info): Call
	camel_store_sync before doing anything else so that the IMAP
	server and Camel are working from the same data. Don't ask the
	server for the unread message count of the current folder, since
	UW will return often-incorrect cached data, and we can calculate
	it without talking to the server anyway.

svn path=/trunk/; revision=7365
2001-01-10 17:10:44 +00:00
461e7fcb4f Mostly IMAP changes. Use the NAMESPACE extension (where
available). Deal with servers that don't return LIST flags in
	response to LSUB (like UW) to get rid of the "not a selectable
	folder" error messages in the UI. Take advantage of the \Marked
	and \Unmarked flags to try to speed up the folder scan by not
	doing STATUS on unmarked folders. Some further tweaks on the shape
	of the resulting folder tree in various situations...

	* camel-store.h: Remove the (read) message_count, since nothing
	uses it, and we can speed up IMAP a bit this way.

	* camel-store.c (camel_folder_info_build): Redo this a bit to make
	it more useful for IMAP since that's the only thing that uses it.

	* camel-remote-store.c (camel_remote_store_connected): Public
	function to check if the store is connected, and try to connect it
	if it's not.
	(remote_send_string, remote_send_stream, remote_recv_line): Use
	that.

	* providers/imap/camel-imap-store.c (camel_imap_store_finalize):
	fix up for changes.
	(camel_imap_store_init): Initialize subscribed_folders to NULL
	rather than an empty hash table.
	(imap_connect): Get the list of subscribed folders here. If the
	server doesn't claim that any of them are either Marked or
	Unmarked, then assume that it doesn't do that for LSUB and
	remember that for later. If the server supports the NAMESPACE
	extension and the user didn't specify a namespace, use the
	server-provided one.
	(imap_disconnect): Free the list of subscribed folders, and the
	namespace.
	(get_folder): check camel_remote_store_connected
	(get_folder_info): check camel_remote_store_connected. Add a bunch
	of new cleverness. If we learned that the server doesn't do LSUB
	usefully, do a bunch of LISTs by hand. Then, if we're getting
	unread counts, only do it for folders that weren't listed as
	Unmarked. Also, deal with namespaces that end with the separator
	character, and update for changes to camel_folder_info_build.
	(folder_subscribed): Add a g_return_val_if_fail.
	(subscribe_folder, unsubscribe_folder): check
	camel_remote_store_connected.

	* providers/nntp/camel-nntp-store.c (build_folder_info,
	build_folder_info_from_grouplist, nntp_store_get_folder_info):
	Don't fill in message_count since it doesn't exist any more.

svn path=/trunk/; revision=7343
2001-01-09 22:25:50 +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
a6ee833694 Updated the gtk-doc comment.
2000-11-29  Jeffrey Stedfast  <fejj@helixcode.com>

	* camel-store.c (camel_store_get_folder): Updated the gtk-doc
	comment.

svn path=/trunk/; revision=6725
2000-11-29 21:35:14 +00:00
d38a417de3 Add a missed unref.
2000-11-29  Not Zed  <NotZed@HelixCode.com>

	* tests/message/test2.c (main): Add a missed unref.

	* camel-stream-mem.c (camel_stream_mem_set_buffer): We must set
	ourselves as the owner of the byte-array.
	Weird, someone has modified this file (its been reindented), but i
	can't see any changelogs ...

	* tests/lib/messages.c (content_finalise): Fix memleak in tester,
	free byte array when our content object is deleted.

	* camel-folder-search.c (camel_folder_search_finalize): Yeah
	great, so the sexp is a gtk object, not a camel object.  Isn't
	that going to be fun to fix?

	* camel-session.c (camel_session_finalise): Free the storage path.

	* providers/local/camel-local-store.c (camel_local_store_init): If
	store->folders is setup, free it first, then overwrite.  Hmm,
	this seems a bit crappy to me.

	* camel-store.c (camel_store_init): Dont setup store->folders if
	its already setup.

	* camel-exception.c (camel_exception_setv): Removed a memleak.  no
	need to strdup after a strdup_printf!!!

	* camel-address.c (camel_address_finalize): Free the address
	ptrarray, once finished.

	* providers/local/camel-local-folder.c (local_finalize): Make sure
	we dont leave the folder locked on close.
	(local_finalize): Free summary/search.

	* providers/local/camel-mh-summary.c (mh_summary_next_uid_string):
	Small memleak, always free name after using it.

	* camel-mime-part.c (set_content_object): Free txt after setting
	the header.

	* providers/local/camel-maildir-summary.c (maildir_summary_check):
	Fix a memleak, close the dir after scanning new.
	(message_info_free): Added so we can free the filename cached in
	the messageinfo.
	(camel_maildir_summary_finalise): Free the hostname.

	* tests/folder/test[12].c (main): Clear out camel-test before
	starting.

	* providers/local/camel-mbox-summary.c (mbox_summary_sync_quick):
	Because encode_x_evolution folds the line (sigh, because
	encode_param does, unlike every other function in
	camel-mime-utils), unfold the encoded result before comparing.
	(mbox_summary_sync_quick): Another small memleak, free xevnew once
	finished with it.

	* camel-mime-utils.c (header_decode_quoted_string): Removed a
	redundant check for c=0.
	(header_unfold): New function to un-fold headers.

	* providers/local/camel-local-summary.c
	(local_summary_encode_x_evolution): some problems with encoding
	tags, using the wrong output strings.
	(local_summary_encode_x_evolution): We dont need to append a ;
	either, param_list_format_append() will do it for us.
`

svn path=/trunk/; revision=6711
2000-11-29 10:49:05 +00:00
3998a03ae9 Set the info size's properly, oops!
2000-11-28  Not Zed  <NotZed@HelixCode.com>

	* providers/local/camel-maildir-summary.c
	(camel_maildir_summary_init): Set the info size's properly, oops!

	* tests/lib/folders.[ch]: Folder testing helpers.

	* tests/folder/test2.c: Test basic message ops on folders.

	* tests/folder/test1.c (main): Test basic folder ops on (local)
	stores.

	* providers/local/camel-local-provider.c
	(camel_provider_module_init): Removed some debug.

	* providers/local/camel-maildir-folder.c
	(camel_maildir_folder_class_init): fix parent class.

	* providers/local/camel-mh-folder.c (camel_mh_folder_class_init):
	Fix parent class (damn cut & paste).

	* providers/local/camel-maildir-store.c (get_folder): Call parent
	impl.
	(camel_maildir_store_class_init): Fix parent class setup.
	(delete_folder): Check the folder exists before trying to delete
	it.
	(delete_folder): Try and make the delete operation atomic/rollback
	failures.  e.g. if one directory isn't empty, then create the
	other empty ones back.  Also clear the tmp directory fully first.

	* providers/local/camel-mbox-store.c (get_folder): Call parent
	impl.
	(camel_mbox_store_class_init): parent class is camel_local_store,
	not camel_folder, oops.
	(delete_folder): Return an error if it doesn't exist, rather than
	covering it up.

	* providers/local/camel-mh-store.c (get_folder): Call parent impl.
	(camel_mh_store_class_init): fix parent class setup.
	(delete_folder): Error if it doesn't exist now.

	* camel-folder.c (camel_folder_move_message_to):
	(camel_folder_copy_message_to): Added warnings as these functions
	are going to be removed later.

	* camel-store.c (camel_store_get_root_folder): Fix for an early
	api change.  We want CAMEL_STORE_FOLDER_CREATE, not TRUE, since
	its a flag.
	(camel_store_get_default_folder): And here too.

	* providers/local/camel-local-store.c (xrename): Handle renaming
	folders differently to renaming files.
	(get_default_folder_name): local stores dont have a default
	folder, so make it so.  Or at least, it doesn't seem to make sense
	to have one.
	(get_root_folder_name): Same for root.
	(get_folder): Added parent implementation, that makes sure the
	service path exists, if we are creating a new folder (but doesn't
	create the folder).

2000-11-27  Not Zed  <NotZed@HelixCode.com>

	* providers/local/camel-local-store.c (xrename): Fixed races.  Use
	link/unlink, rather than rename, to properly detect overwriting
	another file.  And allow some files to be missing.

	* providers/Makefile.am: Removed mh, mbox, added local, to the default.

svn path=/trunk/; revision=6693
2000-11-28 13:13:23 +00:00
d4656431e9 Improved IMAP namespace handling: leave the namespace in the
folder names rather than constantly prepending it and stripping it
	off. Also some subscription fixes.

	* camel-store.c (camel_folder_info_build): Fix for the case where
	@top isn't in @folders.

	* providers/imap/camel-imap-folder.c (camel_imap_folder_new): Add
	a "short_name" argument rather than figuring it out ourselves.
	(imap_get_full_name): Implementation of CamelFolder::get_full_name
	that strips off namespace so the user doesn't have to see it.
	(imap_append_message, imap_copy_message_to, imap_move_message_to):
	Use folder->full_name rather than calling
	camel_imap_store_get_folder_path.

	* providers/imap/camel-imap-utils.c (imap_parse_list_response):
	Update this: make @flags a bitmask and @sep a char rather than a
	string. Make all of the out arguments optional. Handle literals in
	the server response.

	* providers/imap/camel-imap-store.c (imap_connect): Do a better
	job of getting the correct dir_sep for the namespace we're using.
	Construct a base_url here that will be used by get_folder_info.
	(camel_imap_store_folder_path): Removed
	(imap_folder_exists): Add an argument to return the short name of
	the folder (parsed out of the LIST response). Update for
	imap_parse_list_response change.
	(get_folder): Update for the various other changes.
	(get_folder_info): Update for the various other changes. Be more
	consistent about the returned layout: put everything underneath
	the "namespace" directory, including INBOX, even if it doesn't
	belong there. Don't destroy the list of subscribed folders until
	we've actually gotten the new list.
	(folder_subscribed, subscribe_folder, unsubscribe_folder): Use
	folder_name directly rather than camel_imap_store_folder_Path.

	* providers/imap/camel-imap-command.c (camel_imap_command): Update
	for folder name changes.

svn path=/trunk/; revision=6256
2000-10-30 03:24:15 +00:00
82185d7faa Add a "parent" field to CamelFolderInfo.
* camel-store.h: Add a "parent" field to CamelFolderInfo.

	* camel-store.c (camel_folder_info_build): Deal with "parent"
	(camel_store_folder_subscribed, camel_store_subscribe_folder,
	camel_store_unsubscribe_folder): Add g_return_if_fails checking
	that the folder supports subscriptions.

	* providers/imap/camel-imap-store.c (folder_subscribed,
	subscribe_folder, unsubscribe_folder): Remove "+ 1"s since the
	mail subscribe UI won't prepend / to the folder names now.
	(get_folder_info): Clear the "parent" field of the folderinfos
	when removing an empty top level.

	* providers/nntp/camel-nntp-store.c (nntp_store_folder_subscribed,
	nntp_store_subscribe_folder, nntp_store_unsubscribe_folder):
	Remove "+ 1"s since the mail subscribe UI won't prepend / to the
	folder names now.

svn path=/trunk/; revision=6167
2000-10-25 15:27:17 +00:00
360675f54b lots of i18n fixes
svn path=/trunk/; revision=6143
2000-10-24 05:23:27 +00:00
229f78b929 No, we must not encode the headers here. These interfaces ARE raw
2000-10-18  Not Zed  <NotZed@HelixCode.com>

	* camel-mime-part.c (add_header): No, we must not encode the
	headers here.  These interfaces ARE raw interfaces as they are
	defined in camel_medium.  Also removed a bogus/meaningless FIXME.
	(set_header): Likewise here, we must not.
	(process_header): Removed another bogus comment.

	* camel-object.c (shared_is_of_type): Comment out the spitting of
	a big warning when we're trying to determine types from code.

	* providers/mbox/camel-mbox-summary.c
	(message_info_new_from_parser): Only call ibex funcitons if we
	have an index.

	* providers/mh/camel-mh-summary.c (camel_mh_summary_add): Only
	call ibex functions if we have an index.
	(remove_summary): Likewise.
	(camel_mh_summary_check): Likewise.

	* providers/nntp/camel-nntp-store.c (nntp_store_get_folder):
	get_folder -> flags argument.

	* providers/vee/camel-vee-store.c (vee_get_folder): create->flags.

	* providers/pop3/camel-pop3-store.c (get_folder): Changed create
	-> flags.

	* providers/imap/camel-imap-store.c (get_folder): Added flags
	argument.

	* providers/mh/camel-mh-folder.c (camel_mh_folder_new): Added
	flags argument, and fixed code appropriately.

	* providers/mh/camel-mh-store.c (get_folder): Added flags argument.

	* camel-folder-search.c (message_body_contains): Perform a regex
	match on the contents of messages.  This wont quite work yet as
	message contents are encoded when written to a stream.
	(build_match_regex): Converts a number of strings into a regex
	matching pattern, escaping special chars.
	(match_message): match a single message from a folder, by uid.
	Slow.
	(search_body_contains): Changed to support matching where no index
	is supplied.  Matches are performed by retrieving message
	contents, etc.
	() WTF?  camel should not be including any widget headers.

	* providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new):
	Added flags argument.
	(mbox_refresh_info): Changed into a NOP, the refresh info code
	moved into the new function.
	(camel_mbox_folder_new): If we have an index requested, build one,
	otherwise, remove an old one, or just dont do anything.

	* providers/mbox/camel-mbox-store.c (get_folder): Changed create
	to flags, changed code to suit.

	* camel-store.c (camel_store_get_folder): Changed create to flags.
	(get_folder_internal): And here.
	(get_folder): And here too.

	* camel-store.h (camel_store_get_folder): Change the create
	argument to be a flags argument.

svn path=/trunk/; revision=5978
2000-10-18 06:11:54 +00:00
912d759d75 add camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): add
2000-10-06  Chris Toshok  <toshok@helixcode.com>

	* providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add
	camel-nntp-grouplist.h
	(libcamelnntp_la_SOURCES): add camel-nntp-grouplist.c

	* providers/nntp/camel-nntp-provider.c: add our own hash functions
	for nntp urls.

	* providers/nntp/camel-nntp-newsrc.c
	(camel_nntp_newsrc_group_is_subscribed): new function.
	(camel_nntp_newsrc_subscribe_group): new function.
	(camel_nntp_newsrc_unsubscribe_group): new function.

	* providers/nntp/camel-nntp-newsrc.h: add prototypes for
	_group_is_subscribed, _subscribe_group, and _unsubscribe_group.

	* providers/nntp/camel-nntp-store.c
	(build_folder_info_from_grouplist): new function.
	(nntp_store_get_folder_info): add subscribed_only_parameter.  if
	it's FALSE, load the grouplist and call
	build_folder_info_from_grouplist.
	(nntp_store_folder_subscribed): implement.
	(nntp_store_subscribe_folder): implement.
	(nntp_store_unsubscribe_folder): implement.
	(camel_nntp_store_init): add CAMEL_STORE_SUBSCRIPTIONS to the
	store's flags.

	* providers/mh/camel-mh-store.c (get_folder_info): add
	subscribed_only parameter.

	* providers/mbox/camel-mbox-store.c (get_folder_info): add
	subscribed_only parameter.

	* providers/imap/camel-imap-store.c (get_folder_info): add
	subscribed_only parameter.

	* camel-store.c (camel_store_supports_subscriptions): new function.
	(camel_store_folder_subscribed): new function.
	(camel_store_subscribe_folder): new function.
	(camel_store_unsubscribe_folder): new function.

	* camel-store.h: add prototypes and virtual functions for the
	subscribe implementation.  also, add a subscribed_only argument to
	camel_store_get_folder_info.

svn path=/trunk/; revision=5760
2000-10-06 08:25:36 +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
da570c6660 CamelRemoteStore: a new generic store for stores that connect to servers. Prepare for the ability to cancel operations (much better exception handling). Clean up IMAP like nobody's business
svn path=/trunk/; revision=5103
2000-08-29 21:28:46 +00:00
130bb0e571 Automatically connect services when given a valid URL (should hopefully disconnect, too); remove the old movemail folder correctly.
svn path=/trunk/; revision=4965
2000-08-22 20:09:11 +00:00
8cb514d6dd Merge with camel-async.
svn path=/trunk/; revision=4687
2000-08-10 17:30:50 +00:00
a7943ce5a4 Only retry another uid if we had a name clash, otherwise fail.
2000-08-07  Not Zed  <NotZed@HelixCode.com>

        * providers/mh/camel-mh-folder.c (mh_append_message): Only retry
        another uid if we had a name clash, otherwise fail.

2000-08-04  Not Zed  <NotZed@HelixCode.com>

        * camel-url.c (camel_url_set_protocol):
        (camel_url_set_host):
        (camel_url_set_path):
        (camel_url_set_port): Url editing functions.

2000-08-02  Not Zed  <NotZed@HelixCode.com>

        * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Expunge
        from the end, so the index isn't messed up when you remove a
        message.

        * providers/mh/camel-mh-folder.c (mh_append_message): Fix a bug
        where it would never open an output file/uid.

        * providers/mbox/camel-mbox-store.c (rename_folder):
        Implementation for mbox as well.

        * camel-store.c (camel_store_rename_folder): New method to rename folders.
        (rename_folder): Default implementation.

        * providers/mh/camel-mh-store.c (delete_folder): Implement this.
        (rename_folder): Implement a rename operation.

svn path=/trunk/; revision=4590
2000-08-08 03:42:47 +00:00
4d5427769c Remove exists, create, delete. A CamelFolder now always references an
* camel-folder.c: Remove exists, create, delete. A CamelFolder
	now always references an existing folder. Remove delete_messages
	too since it wasn't being used. Add a "create" flag to
	get_subfolder saying whether or not to create the subfolder if it
	doesn't yet exist.

	* camel-store.c (camel_store_get_folder): Add a "create" flag to
	say whether or not to create the folder if it doesn't yet exist.
	(camel_store_delete_folder): New method, moved from CamelFolder.
	(cache_folder, uncache_folder): Fix up a bit.
	(get_folder_name): Explain what this is for.

	* providers/mbox/camel-mbox-folder.c:
	* providers/mbox/camel-mbox-store.c: Update. Remove support for
	hierarchical folders to simplify this for now, since we're not
	using it, and it's not completely clear how they should work in an
	ELocalStorage world. Needs to be revisited.

	* providers/pop3/camel-pop3-folder.c (delete_messages): Remove.
	* providers/pop3/camel-pop3-store.c (get_folder): Update.

	* providers/vee/camel-vee-folder.c (exists): Remove.
	* providers/vee/camel-vee-store.c (vee_get_folder): Update.

svn path=/trunk/; revision=3453
2000-06-07 00:06:29 +00:00
8d6afbe910 Ref and unref objects in the service cache properly.
2000-06-02  Christopher James Lahey  <clahey@helixcode.com>

	* camel-session.c: Ref and unref objects in the service cache
	properly.

	* camel-store.c: Ref the folder when returning it using
	lookup_folder.  Used the folder's full name for the key for the
	folder cache since that's used to uncache it.

svn path=/trunk/; revision=3388
2000-06-02 16:12:26 +00:00
631dda8ae0 Init filter_from to NULL, for exception case. (mbox_get_message_by_uid):
2000-05-30  Not Zed  <NotZed@HelixCode.com>

        * providers/mbox/camel-mbox-folder.c (mbox_append_message): Init
        filter_from to NULL, for exception case.
        (mbox_get_message_by_uid): Cast off_t to long int for diagnostics.

        * camel-url.c (camel_url_hash): Hash funciton for using camel
        url's as hash keys.
        (camel_url_equal): equal function for same.

        * camel-session.c (camel_session_finalise): Free cached services.
        (camel_session_init): Init service cache.
        (service_cache_remove): destroy callback to remove a service from
        the cache.

        * camel-store.c (get_folder_internal): Remove the extra ref of the
        folder.  That seems the right behaviour ...?
        (camel_store_get_type): Doh, actually call store init, so the
        cache works.
        (cache_folder): strdup the folder name!  no wonder it never found
        it again.

svn path=/trunk/; revision=3298
2000-05-30 22:35:40 +00:00
3cc160e17b diff -r1.206 ChangeLog
2a3,9
> 	* camel-store.c (camel_store_init): Move it to here.  If this
> 	level is going to maintain it, it should set it up.  Lets see what
> 	caching folders breaks :(
>
> 	* providers/pop3/camel-pop3-store.c (camel_pop3_store_init): Dont
> 	init folder cache here.
>
7a15,16
> 	(camel_mbox_summary_expunge): Remove some debug, and dont offset
> 	frompos?

svn path=/trunk/; revision=3274
2000-05-30 01:05:18 +00:00
fe97fa2fbb kill camel-log
svn path=/trunk/; revision=2487
2000-04-18 19:05:15 +00:00
f3f2afef4c Reorganize the folder-fetching methods and implement a folder cache so
2000-04-06  Dan Winship  <danw@helixcode.com>

	* camel-store.[ch]: Reorganize the folder-fetching methods and
	implement a folder cache so that multiple requests for the same
	folder will yield the same CamelFolder object (as long as it
	remains active). Includes some code to remove no-longer-active
	folders from the cache, but it doesn't get used since nothing is
	ever unref'ed in Camel right now...

	* providers/mbox/camel-mbox-store.c:
	* providers/pop3/camel-pop3-store.c: update for CamelStore
	changes.

	* camel-folder.[ch]: Remove the (unused) CamelException argument
	from camel_folder_get_name and camel_folder_get_full_name.
	(camel_folder_set_name): make this go away since changing a
	folder's name after it has been created could result in it
	conflicting with a separately-issued folder.

svn path=/trunk/; revision=2314
2000-04-06 20:10:05 +00:00
c7ae879700 fix warnings
svn path=/trunk/; revision=2217
2000-03-28 21:12:12 +00:00
1e7ab47d26 fix the name of "Helix Code, Inc." in all the copyrights
svn path=/trunk/; revision=2091
2000-03-09 19:52:48 +00:00
4ec5c4b998 Move "separator" from camel-store to camel-folder, since it can vary from
location to location in an IMAP store. Rename CamelFolder::init_with_store
to init and add parent_folder, name, and separator arguments.

svn path=/trunk/; revision=1919
2000-02-24 16:43:09 +00:00
d3d2adb98c add CamelExceptions to several functions. Use camel_session_new to
* camel-session.h:
        * camel-session.c: add CamelExceptions to several functions. Use
        camel_session_new to initialize the session and URL fields of
        created CamelStores as appropriate.

        * camel-store.h:
        * camel-store.c
        * camel-service.h:
        * camel-service.c: Move the session and url (and associated
        functions) from CamelStore to CamelService. Add url_flags to
        CamelService so subclasses can specify which URL components
        are mandatory for them. Add camel_session_new for
        camel_session_get_store* to use.

        * providers/mbox/camel-mbox-folder.c:
        * providers/mbox/camel-mbox-store.c:
        * providers/mbox/camel-mbox-store.h: Update for above changes.

svn path=/trunk/; revision=1888
2000-02-21 18:38:58 +00:00
e72c45d304 New header with the typedefs for all camel classes. Now the class headers
* camel/camel-types.h: New header with the typedefs for all camel
	classes. Now the class headers can just include this and the
	header for the parent type. This makes it possible for
	CamelService to include a CamelSession without creating an
	#include loop.

	* camel/*:
	* composer/e-msg-composer-attachment-bar.h:
	* mail/folder-browser.c:
	* mail/message-list.c: frob #includes to match the new reality

svn path=/trunk/; revision=1850
2000-02-19 01:40:57 +00:00
cd9e88989f fix minor typos
svn path=/trunk/; revision=1795
2000-02-16 15:44:55 +00:00
98e15c6b5c add recipient_list to the recipients, not recipients_list. I don't know
2000-01-24  bertrand  <bertrand@helixcode.com>

	* camel/camel-recipient.c (camel_recipient_table_add_list):
	add recipient_list to the recipients, not recipients_list.
	I don't know what that variable was doing here.

2000-01-23  bertrand  <bertrand@helixcode.com>

	* camel/camel-store.c (camel_store_get_session):
	added a public get_session method.

	* camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
	(camel_mbox_load_summary): load/save message sizes in the summary file

	* camel/providers/mbox/camel-mbox-summary.h:
	added a size field to the message information
	structure.

	* camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
	copy message size to the mbox summary information too.

	* camel/camel-stream-fs.c (_seek): updated to
	work with bounded fs streams.
	(_write): ditto.
	(_read): ditto.

	* camel/camel-stream-fs.h (struct ):
	added the cur_pos, inf_bound and sup_bound
	members to allow for bounded fs stream.

	* camel/camel-stream-fs.c (_set_bounds): new func.
	(_init_with_fd_and_bounds): idem.
	(_init_with_name_and_bounds): idem.
	New functions to allow the usage of bounded fs streams.

	The bounded fs stream allow, for example, to make a stream
	from a message stored in an mbox file.

svn path=/trunk/; revision=1620
2000-01-24 15:07:18 +00:00
e8a2fed920 add exception handling everywhere in the store related functions
2000-01-21  bertrand  <bertrand@helixcode.com>

	* camel/camel-store.c: add exception handling everywhere in
	the store related functions arguments.
	* camel/providers/mbox/camel-mbox-folder.c: idem
	* camel/providers/mbox/camel-mbox-folder.h: idem
	* camel/providers/mbox/camel-mbox-store.h: idem

	* camel/providers/mbox/Makefile.am (libcamelmbox_la_SOURCES):
	added camel-mbox-provider.c to the mbox provider
	sources.

svn path=/trunk/; revision=1605
2000-01-22 01:35:11 +00:00
316a4c47ff Updated my e-mail address to reflect my new employment
svn path=/trunk/; revision=1533
2000-01-03 23:05:55 +00:00
331335d12c Fix copyright informations once again
svn path=/trunk/; revision=1489
1999-12-14 22:40:38 +00:00
8fe1aa5f41 Copyright change
svn path=/trunk/; revision=1348
1999-10-23 15:19:51 +00:00
d938232d3c Address update
svn path=/trunk/; revision=1147
1999-08-29 22:13:34 +00:00
1c721c4abb remove stupid debug code. (add_mail_store): use camel_session_get_store
1999-08-12  bertrand  <Bertrand.Guiheneuf@aful.org>

	* tests/ui-tests/store_listing.c (show_folder_messages):
	remove stupid debug code.
	(add_mail_store): use camel_session_get_store instead
	of creating MH store directly.
	(main): load MH provider.

	* camel/camel-provider.c (camel_provider_register_as_module):
	register new provider.
	(camel_provider_get_for_protocol):
	Now, implementation is correct.

	* camel/camel-store.c (_finalize):
	* camel/camel-store.h (struct _CamelStore):
	further disabled url_name field use.
	URL will be generated dynamically.

Ben dam don dieu, vla t'y pas que ya tout le bourier qui marche !
(Autoload store/protocol from URL works)

svn path=/trunk/; revision=1108
1999-08-12 21:01:07 +00:00