Commit Graph

100 Commits

Author SHA1 Message Date
Jeffrey Stedfast e42b0f2061 Added a g_return_val_if_fail for folder_name != NULL.
2001-11-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_get_folder): Added a
	g_return_val_if_fail for folder_name != NULL.

svn path=/trunk/; revision=14676
2001-11-12 23:22:36 +00:00
0 613e004309 Dont try to move ibex if we have none.
2001-10-30    <NotZed@Ximian.com>

        * providers/local/camel-local-store.c (rename_folder): Dont try to
        move ibex if we have none.

svn path=/trunk/; revision=14429
2001-10-30 05:20:50 +00:00
Jeffrey Stedfast 921c64fb60 Don't emit a folder_subscribed signal if we are in the process of renaming
2001-10-29  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/imap/camel-imap-store.c (subscribe_folder): Don't emit
	a folder_subscribed signal if we are in the process of renaming
	folders.
	(unsubscribe_folder): Same here but for the unsubscribe signal.
	(rename_folder): Unsubscribe from the folder being renamed and any
	subfolders it may have before actually renaming. Once the folder
	has been renamed, re-subscribe to it and it's subfolders with the
	new name.

	* camel-store.c (camel_folder_info_build): Sort the folder info's
	before constructing the tree.

svn path=/trunk/; revision=14378
2001-10-29 23:23:12 +00:00
9 8e598e640e Fix the 'is this a matching subfolder or subfolder'' logic to match
2001-10-29    <NotZed@Ximian.com>

        * camel-vee-store.c (build_info): Fix the 'is this a matching
        subfolder or subfolder'' logic to match camel-store
        get_subfolders'.

        * camel-store.c (get_subfolders): Fix the 'is this a matching
        folder or subfolder' logic.

svn path=/trunk/; revision=14324
2001-10-29 05:06:59 +00:00
8 4ee4cf5693 Use the right variable, not info.
2001-10-28    <NotZed@Ximian.com>

	* camel-store.c (camel_store_rename_folder): Use the right variable, not info.

svn path=/trunk/; revision=14290
2001-10-28 10:51:19 +00:00
8 78b66af8ce Use path not protocol as the path part of the uri of the folder_created
2001-10-28    <NotZed@Ximian.com>

	* providers/local/camel-local-folder.c
	(camel_local_folder_construct): Use path not protocol as the path
	part of the uri of the folder_created event.

	* providers/local/camel-maildir-store.c (scan_dir): If FAST is
	set, dont try and scan for unread counts.

	* providers/local/camel-local-store.c (create_folder): Implement,
	just return the folderinfo of the folder matched, not all of it.

	* camel-store.c (camel_store_rename_folder): Rename the
	camelfolders before emitting the folderchanged event (otherwise
	vstore fails to pick up change.

	* camel-store.c (camel_store_init): Always use a default dir_sep
	of '/'.

	* camel-store.h (struct _CamelStore): Added a dir_sep to the base
	store so rename and whatnot can work, temporary fix for mixed dir
	separator in folder name api's.

	* providers/imap/camel-map-store.c:
	(imap_connect_online): Also set the store's dir_sep here.
	(imap_connect_offline): "

svn path=/trunk/; revision=14275
2001-10-28 05:10:56 +00:00
Ettore Perazzoli 08fb7329cb Fixing the license text.
svn path=/trunk/; revision=14212
2001-10-27 16:59:46 +00:00
7 c4d87ba45a Finished implementation.
2001-10-27    <NotZed@Ximian.com>

        * providers/imap/camel-imap-store.c (rename_folder): Finished
        implementation.

        * providers/local/camel-local-folder.c (local_rename): Implement
        local rename of folder objects.

2001-10-26    <NotZed@Ximian.com>

        * camel-vee-folder.c (camel_vee_folder_class_init): Hook into
        rename function.
        (vee_rename): Implement the veefolder rename function.
        (camel_vee_folder_class_init):
        (folder_changed_change): Kill a warning with a cast.

        * camel-vee-store.c (vee_rename_folder): Emit a folder_renamed
        event properly, also call parent to do some rename stuff.

        * camel-store.h: Added a CamelRenameInfo for the rename event.

        * camel-folder.c (camel_folder_rename): New function to rename a
        folder object.
        (camel_folder_class_init): Added a renamed event.
        (folder_rename): Default impl, set full_name, and set name
        assuming the dir separator is '/'.

        * camel-store.c (camel_store_class_init): Added folder_renamed
        event.
        (camel_store_rename_folder): Rename an active folder object if we
        have one, and update the folder table.
        (rename_folder): Make a default implementation that handles
        updating the folder tree.

svn path=/trunk/; revision=14204
2001-10-27 06:00:34 +00:00
Ettore Perazzoli 02dcd0aadf Update the licensing information to require version 2 of the GPL
(instead of version 2 or any later version).

svn path=/trunk/; revision=14190
2001-10-27 00:25:49 +00:00
Jeffrey Stedfast 2eb6b07427 Updated comments to make the code a bit more clear.
2001-10-21  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_folder_info_build): Updated comments to
	make the code a bit more clear.

svn path=/trunk/; revision=13859
2001-10-22 00:45:25 +00:00
1 c435267723 Dont do the macro stuff - basically so you can actually debug calls.
2001-10-21    <NotZed@Ximian.com>

        * camel-store.c (CS_CLASS): Dont do the macro stuff - basically so
        you can actually debug calls.
        (camel_store_uri_cmp): New function to compare store objects.

        * camel-vee-folder.c (vee_folder_add_info): oops, dont free the
        vuid, since its alloca'd now.
        (folder_changed_change): Kill a compile warning.

svn path=/trunk/; revision=13855
2001-10-21 20:27:43 +00:00
9 0515ef5e4d Lock the right lock for unmatched subfolder list stuff. If the sub folder
2001-10-19    <NotZed@Ximian.com>

	* camel-vee-folder.c (camel_vee_folder_remove_folder): Lock the
	right lock for unmatched subfolder list stuff.  If the sub folder
	is deleted & part of unmatched, or the last ref to the sub folder
	is gone from unmatched, blow it away completely from unmatched,
	but only do it once.
	(vee_folder_remove_folder): Added arg to kill unmatched
	unconditionally.  Also handle deleted folders, always remove
	stuff.
	(folder_changed_change): Lock subfolder lock for entirety of
	operation, and also check to see if the subfolder is still there
	before doing any fancy work (incase it got removed while we were
	waiting to execute).

	* camel-store.c (camel_store_unsubscribe_folder): If we are
	unsubscribing from a folder we have loaded, set the folder
	deleted, as with the delete_folder case.

svn path=/trunk/; revision=13786
2001-10-19 05:33:21 +00:00
7 4b9dbd4269 New function to clone a folderinfo tree.
2001-10-17    <NotZed@Ximian.com>

        * camel-store.c (camel_folder_info_clone): New function to clone a
        folderinfo tree.

svn path=/trunk/; revision=13740
2001-10-17 22:44:27 +00:00
5 5ad2032478 Use a folder_subscribed event rather than a folder_created one.
2001-10-05    <NotZed@Ximian.com>

        * providers/imap/camel-imap-store.c (subscribe_folder): Use a
        folder_subscribed event rather than a folder_created one.
        (unsubscribe_folder): Similarly for unsubscribed/deleted.
        (create_folder): Emit a folder_created event on the folders we
        added.  Not sure hsould probably check which ones are new and
        which ones are just existing ones?
        (delete_folder): Emit a folder_deletd event when we've deleted the
        folder.  Part of fix for #11831.

        * camel-store.c (camel_store_class_init): Added
        folder_subscribed/unsubscribed events.

svn path=/trunk/; revision=13471
2001-10-05 21:49:17 +00:00
Jeffrey Stedfast ba39d4fff5 Turn off warnings. (get_name): Same.
2001-10-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-service.c (camel_service_finalize): Turn off warnings.
	(get_name): Same.

	* camel-sasl.c (sasl_challenge): Turn off warnings.

	* camel-tcp-stream.c (tcp_connect): Turn off warnings.
	(tcp_getsockopt): Same.
	(tcp_setsockopt): Here too.
	(tcp_get_socket): And here.

	* camel-folder.c (folder_sync): Turn off warnings.
	(expunge): Same.
	(append_message): Here too.
	(get_message): And here.
	(search_by_expression): And again here.
	(folder_changed): Here too.

	* camel-store.c (get_folder): Set an exception and turn off
	debugging g_warnings.
	(create_folder): Same.
	(delete_folder): Here too.
	(rename_folder): And here.
	(get_trash): And here.
	(get_folder_info): Same.
	(free_folder_info): And again here.
	(camel_folder_info_build): Here too.
	(folder_subscribed): Same.
	(subscribe_folder): Here too.
	(unsubscribe_folder): And here.

svn path=/trunk/; revision=13458
2001-10-05 19:38:24 +00:00
4 d8eb6abb18 Change the order of execution slightly. We delete the folder first, then
2001-10-04    <NotZed@Ximian.com>

        * camel-store.c (camel_store_delete_folder): Change the order of
        execution slightly.  We delete the folder first, then call the
        classes delete folder, then cleanup the hashtable afterwards.
        This is so deletes of vfolders work, since vee-store uses the
        folder hashtable to store all of is vfolders :-/

svn path=/trunk/; revision=13448
2001-10-05 18:08:22 +00:00
Jeffrey Stedfast 7708b2d8a0 Call camel_folder_delete() on the folder if it's "alive".
2001-10-03  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_delete_folder): Call
	camel_folder_delete() on the folder if it's "alive".

	* camel-folder.c (camel_folder_delete): Mark the folder as
	deleted, perform any folder specific cleanup and emit the deleted
	event.
	(camel_folder_sync): Only sync the folder if it hasn't been
	deleted.
	(camel_folder_expunge): Same.

svn path=/trunk/; revision=13388
2001-10-03 21:25:04 +00:00
Jeffrey Stedfast a0c093ed24 CRLF decode the stream before parsing it into a MIME part. This fixes bug
2001-09-27  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-mime.c (camel_pgp_mime_part_decrypt): CRLF decode the
	stream before parsing it into a MIME part. This fixes bug #10521.

	* camel-store.c: Remove the old folder from the vTrash folder.

svn path=/trunk/; revision=13199
2001-09-27 22:32:11 +00:00
1 cc292b9bb6 Set the exception if create_folder isn't implemented.
2001-09-21    <NotZed@Ximian.com>

        * camel-store.c (create_folder): Set the exception if
        create_folder isn't implemented.

svn path=/trunk/; revision=13056
2001-09-21 20:01:24 +00:00
Michael Zucci 5de6e2a14b Setup unread count properly, and also setup the url properly.
* providers/local/camel-local-folder.c
	(camel_local_folder_construct): Setup unread count properly, and
	also setup the url properly.

	(scan_dir): Dont include empty host part in url for folder.
	(scan_dir): Lookup folder counts for any folders we currenty have
	open.

svn path=/trunk/; revision=13035
2001-09-21 00:55:36 +00:00
0 a6aba35df1 Build the path on the folderinfo.
2001-09-20    <NotZed@Ximian.com>

        * providers/local/camel-maildir-store.c (camel_folder_info_new):
        Build the path on the folderinfo.

        * providers/local/camel-spool-store.c (get_folder_info): If we
        have this folder open, then set unread from the folder itself.
        (get_folder_info): Change the INBOX path to not include the
        leading /.

        * providers/local/camel-spool-folder.c
        (camel_spool_folder_construct): Fix path.
        (camel_spool_folder_construct): Properly setup the url field when
        we say we've got a new folder created.

        * providers/imap/camel-imap-store.c (unsubscribe_folder): Build
        path on folderinfo.

        * camel-store.c (camel_folder_info_build_path): Prepend / to path.

        * camel-vee-folder.c (camel_vee_folder_construct): Use macro for
        unmatched folder name.
        (camel_vee_folder_new): "

        * camel-vee-store.c (vee_get_folder_info): Use macro for unmatched
        folder name.
        (vee_delete_folder): "
        (vee_rename_folder): "
        (vee_get_folder): Prepend / onto path.
        (vee_delete_folder): Setup path in folderinfo.
        (vee_get_folder_info): Fix path in folderinfo.

        * camel-vee-folder.h (CAMEL_UNMATCHED_NAME): New define for
        unmatched (internal) name.

svn path=/trunk/; revision=13022
2001-09-20 22:58:23 +00:00
Jeffrey Stedfast d728e1e79c And finally here.
2001-09-20  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/local/camel-spool-folder.c
	(camel_spool_folder_construct): And finally here.

	* providers/local/camel-local-folder.c
	(camel_local_folder_construct): And here.

	* camel-vee-store.c (vee_get_folder): ANd here too.
	(vee_get_folder_info): And here.

	* providers/imap/camel-imap-store.c (create_folder): Use
	camel_folder_info_build() and do better error checking.
	(subscribe_folder): Set the path on the folder info.

	* camel-store.c (camel_folder_info_build): Set the folder-info
	path if it hasn't already been set by the caller.
	(camel_folder_info_free): Free the path.

	* camel-store.h: Added a path member to the FolderInfo type.

svn path=/trunk/; revision=13019
2001-09-20 21:28:10 +00:00
9 bef39dc4e0 General cleanup of camel debug printfs.
2001-09-19    <NotZed@Ximian.com>

        * General cleanup of camel debug printfs.

        * camel-lock.c (camel_lock_fcntl): Changed to return 'success' if
        the error indicates file locking isn't supported on this
        filesystem.  Still return a warning just incase (if its the first
        time).  Might fix a lot of reported bugs.

        * providers/local/camel-spool-store.c (get_folder_info): Dont
        include the empty // host part in the uri.  This 'breaks' the
        service lookup.

svn path=/trunk/; revision=12973
2001-09-19 08:28:36 +00:00
8 8347ce1403 If filter inbox is set on the store, and we're opening inbox '', then
2001-09-18    <NotZed@Ximian.com>

	* providers/local/camel-maildir-folder.c
	(camel_maildir_folder_new): If filter inbox is set on the store,
	and we're opening inbox '', then enable filtering on new messages.

	* providers/local/camel-local-folder.c
	(camel_local_folder_construct): After loading the summary, check
	it, and only abort if that fails.  Also maintain the changes
	count.

	* providers/local/camel-local-summary.c
	(camel_local_summary_load): Remove summary_check code from here.
	(camel_local_summary_check): Sync index/summary here, if we were
	successful.

	* providers/local/camel-spool-folder.c
	(camel_spool_folder_new): If we have filter-new-messages-on-inbox
	set and we just opened inbox, turn on filtering on this folder.
	(camel_spool_folder_construct): Keep track of changes for the
	folder, so that filter-new-messages works right (?)

	* providers/local/camel-spool-store.c (get_folder): Pass 'INBOX'
	as the folder name, not the path.

	* camel-folder-search.c (search_not): Modified patch from
	<peterw@ximian.com> since the summary is messageinfo's, not
	strings.

	** Ok so the problem with the stuff below is that maildir/spool
	'summary_load' throws away all events, including recents, joy eh?

	* providers/local/camel-maildir-summary.c (maildir_summary_check):
	Add new messages to the recent changeinfo.

	* providers/local/camel-spool-summary.c: Mark 'new' message as
	recent, for later processing if required (i.e. 'filter new
	messages').

	* camel-store.c (construct): new function, cascade up construct
	method and check for 'filter' param, and set accordingly for any
	one that might want it.

	* providers/imap/camel-imap-store.c (construct): map the
	param_filter_inbox flag to the store->flags as
	CAMEL_STORE_FILTER_INBOX.

	* camel-store.h (CAMEL_STORE_FILTER_INBOX): new flag to tell it to
	filter inbox.

	* providers/imap/camel-imap-folder.h: Removed do_filtering flag
	from CamelImapFolder.

	* providers/imap/camel-imap-folder.c (imap_update_summary): Remove
	the 'recents' parameter, use the 'changes' parameter instead to
	convey this info.
	(camel_imap_folder_changed): Changed for update_summary api
	change.  Now always just emit the changed event if we have any
	changes to report, filtering code removed, handled upstream.
	(filter_proc):
	(filter_free): Removed old filtering code.
	(camel_imap_folder_new): Set the filter_recent flag on the folder
	if we're the inbox and filtering of inbox is enabled.

	* camel-folder.c (folder_changed): If we have 'recent' messages,
	and are set to filter recents, then freeze the folder and launch a
	thread to do the processing (or similar if threading not enabled).
	(thaw): Make sure we emit the changed signal outside of owning the
	lock and if things have changed.  Also, no longer bother
	downgrading folder_changed events to message_changed events.

	* camel-folder.h (struct _CamelFolder): Added filter_recent flag
	-> signifies all recent messages in folder should be filtered.

	* camel-session.c: (camel_session_thread_msg_new,
	camel_session_thread_msg_free, camel_session_thread_queue,
	camel_session_thread_wait): code to handle async operations as
	part of camel processing.
	(camel_session_finalise): free thread_lock, destroy thread, active
	hash, etc.
	(camel_session_init): init thread, active hash, etc.
	(camel_session_class_init): Init virtual functions.
	(session_thread_msg_new, session_thread_msg_free,
	session_thread_destroy, session_thread_received,
	session_thread_queue, session_thread_wait): default implementation
	of session threads stuff.

2001-09-17    <NotZed@Ximian.com>

	* camel-folder.c (camel_folder_change_info_recent_uid): New
	function to add a 'recent' uid to the change info.
	(camel_folder_change_info_clear): Clear recent list.
	(camel_folder_change_info_free): Free recent list.
	(camel_folder_change_info_new): Setup recent list.

	* camel-folder.h: Added a uid_recent item to the folder_changed
	event data.

	* providers/local/camel-maildir-store.c (scan_dir): Free new in
	the right block.

	* providers/local/camel-local-provider.c: Add local config entries
	to filter on new messages in spool and maildir provider.

	* camel-vee-folder.c (vee_folder_construct): Remove the assertion
	which stops ? in names from being allowed.

svn path=/trunk/; revision=12956
2001-09-18 21:43:00 +00:00
4 466e05c024 New function, set the complete list of folders on a vfolder, all at once.
2001-09-14    <NotZed@Ximian.com>

	* camel-vee-folder.c (camel_vee_folder_set_folders): New function,
	set the complete list of folders on a vfolder, all at once.
	(camel_vee_folder_set_expression): If we set the query to be the
	same thing, dont do anything.

	* camel-vee-store.c (camel_vee_store_init): Turn off vtrash for
	this store.

	* camel-store.c (camel_store_init): Enable vtrash by default via
	flags.
	(camel_store_get_trash): REturn NULL if the store doesn't support
	vtrash.
	(init_trash): Dont init if store doesn't support vtrash.

	* camel-store.h: Add a new flags CAMEL_STORE_VTRASH -> store
	supports vtrash.

2001-09-13    <NotZed@Ximian.com>

	* camel-vee-store.c (vee_get_folder_info): Implement.
	(build_info): Used to build a folder record from the folders
	hashtable.
	(vee_delete_folder): Implemented, remove folder from hashtable.
	(vee_rename_folder): Implemented, remove old folder from
	hashtable, add new one and rename its guts too.

	* camel-store.c (camel_store_rename_folder): Do nothing if we're
	not asked to actually change names.  Also dont do the renamed
	cache check till after we've called the subclass.
	(camel_store_delete_folder): Call the subclass delete firs,t then
	make sure the cache is right.

	* camel-vee-folder.c (vee_folder_construct): Remove support for
	name?query syntax to setup vfolder.  Abort if such syntax is used.
	(camel_vee_folder_new): Removed code that handles ? syntax, etc.
	(vee_folder_build_folder): Handle unset expression, treat it as an
	empty search.
	(camel_vee_folder_set_expression): Oops, actually set the
	expression.

	* camel-vtrash-folder.c (camel_vtrash_folder_new): Dont use
	name?query syntax to setup vfolder, but set the expression
	directly.  Also fixes a small memleak.

2001-09-12    <NotZed@Ximian.com>

	* camel-store.c (camel_store_delete_folder): Fixed warnings with a cast.
	(camel_store_rename_folder): "

svn path=/trunk/; revision=12854
2001-09-15 08:12:58 +00:00
0 ec9803b91d Progress reporting while moving messages.
2001-09-10    <NotZed@Ximian.com>

        * camel-folder.c (move_messages_to): Progress reporting while
        moving messages.

        * camel-store.c (camel_store_delete_folder): Make sure we remove
        the folder from our vtrash, if we have it in our opened set, and
        also remove it from our hashtable.
        (camel_store_rename_folder): Remove the old folder name from the
        folder cahce, if it is there.

svn path=/trunk/; revision=12758
2001-09-11 00:26:29 +00:00
Jeffrey Stedfast ed5d621b6d After talking to NotZed, it turns out I was wrong after all. (store_sync):
2001-08-13  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_get_folder): After talking to NotZed,
	it turns out I was wrong after all.
	(store_sync): Create a copy of the folder-cache that owns a ref on
	each of the folders so that if one of the folders get's finalized
	inside store_sync(), we don't run into any locking issues. This is
	mostly meant to solve a problem in IMAP (#6089).

svn path=/trunk/; revision=12032
2001-08-14 19:42:40 +00:00
Jeffrey Stedfast ed41e07a8b We need to be ref'ing the folder if/when we add it to the hash. This may
2001-08-13  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_get_folder): We need to be ref'ing
	the folder if/when we add it to the hash. This may fix bug #6089?
	(camel_store_get_folder): Nevermind, reverted the fix.
	(camel_store_get_folder): No, I wasn't on crack before after
	all...if we don't ref here, then we're open to a race condition
	later.

svn path=/trunk/; revision=11973
2001-08-13 22:44:57 +00:00
Jeffrey Stedfast f4132b5946 We need to be ref'ing the folder if/when we add it to the hash. This may
2001-08-13  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_get_folder): We need to be ref'ing
	the folder if/when we add it to the hash. This may fix bug #6089?
	(camel_store_get_folder): Nevermind, reverted the fix.

svn path=/trunk/; revision=11969
2001-08-13 22:22:38 +00:00
Jeffrey Stedfast 106b05d139 We need to be ref'ing the folder if/when we add it to the hash. This may
2001-08-13  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_get_folder): We need to be ref'ing
	the folder if/when we add it to the hash. This may fix bug #6089?

svn path=/trunk/; revision=11968
2001-08-13 22:17:00 +00:00
Peter Williams 85a02926e6 In camel:
2001-07-19  Peter Williams  <peterw@ximian.com>

	Policy change: NULL url's are no longer allowed in CamelFolderInfos. They used
	to signify that the folder was, in IMAP jargon, NoSelect; now the same effect
	is achieved by adding a "noselect=yes" parameter to the end of the URL. As far
	as I know, IMAP is the only affected provider.

	* providers/imap/camel-imap-store.c (delete_folder): New function. Implement
	folder deletion.
	(camel_imap_store_class_init): Set the delete_folder class function here.
	(get_folder_status): New function. Utility wrapper around the STATUS command.
	(create_folder): If the parent folder is NoSelect but is empty, delete it
	and recreate it as a a subfolder-containing folder. If it is NoSelect but
	contains messages, set an exception.
	(parse_list_response_as_folder_info): Always set the FolderInfo's URL, but
	add a NoSelect parameter if it isn't selectable.
	(get_folder_info_online): Change logic of removing the namespace to reflect
	URL change. Same for logic of checking unread counts.
	(get_folder_info_online): Use get_folder_status to simplify this.

	* camel-store.c (camel_folder_info_build): When creating
	dummy parents, copy the child's URL and set the NoSelect
	parameter.

In mail:

2001-07-19  Peter Williams  <peterw@ximian.com>

	Track the NoSelect changes in Camel.

	* mail-callbacks.c (create_folders): We don't need to check if
	the URL is NULL or not anymore.

	* component-factory.c (create_noselect_control): New
	function. Create a dummy control for folders that can't contain
	messages (ie \NoSelect)
	(create_view): If the URI says the folder is noselect, make a
	dummy control. FIXME: still should merge in the global UI
	elements.
	(xfer_folder): Don't allow the operation if the destination is
	NoSelect.
	(destination_folder_handle_motion): Ditto.
	(destination_folder_handle_drop): Ditto.

svn path=/trunk/; revision=11237
2001-07-19 21:35:43 +00:00
Peter Williams e8aa23866a Clean up some exception misusage.
2001-07-17  Peter Williams  <peterw@ximian.com>

	Clean up some exception misusage.

	* providers/imap/camel-imap-command.c (camel_imap_command): Use
	our own internal exception for sending the string and transfer it
	to @ex if anything goes wrong.
	(imap_read_response): Use our own internal exception for reading
	the untagged responses and blah blah blah.

	* camel-session.c (get_service): Use our own internal exception
	when constructing the service and transfer it to @ex if anything
	goes wrong.

	* camel-remote-store.c (remote_recv_line): Instead of having
	gboolean exception, use our own internal exception and copy
	it to @ex if anything goes wrong.

	* camel-store.c (store_sync): Create an internal exception
	because sync_folder() checks it for validity. Transfer it to
	@ex when done.

	* camel-exception.c (camel_exception_get_description): If @ex is
	NULL, complain - passing NULL exceptions to Camel is okay, but
	there should be no circumstances under which they're then
	examined.
	(camel_exception_get_id): Same here,
	(camel_exception_xfer): NULL-protect and warn if transferring from
	a NULL exception.

svn path=/trunk/; revision=11177
2001-07-17 21:22:20 +00:00
Jeffrey Stedfast 14f7d6039f Use CAMEL_VTRASH_NAME.
2001-07-17  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (init_trash): Use CAMEL_VTRASH_NAME.

	* camel-vtrash-folder.h: #define CAMEL_VTRASH_NAME

svn path=/trunk/; revision=11158
2001-07-17 16:08:47 +00:00
Ettore Perazzoli 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
Dan Winship 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
Jeffrey Stedfast 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
Kjartan Maraas fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
Jeffrey Stedfast 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
Not Zed 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
Jeffrey Stedfast 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
Jeffrey Stedfast 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
Jeffrey Stedfast 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
Jeffrey Stedfast 0108c726f4 fixed a compile warning in camel-store.
svn path=/trunk/; revision=8382
2001-02-24 20:09:20 +00:00
Jeffrey Stedfast 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
Jeffrey Stedfast 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
Jeffrey Stedfast 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
Dan Winship 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
Dan Winship 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
Dan Winship 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
Dan Winship 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