Commit Graph

392 Commits

Author SHA1 Message Date
1b9b476eac Instead of always creating a new vTrash folder, if the store already has a
2001-03-12  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (add_vtrash_info): Instead of always creating a new
	vTrash folder, if the store already has a Trash folder, replace it
	with the vTrash. Also, name the folder "Trash" instead of "vTrash"
	and i18nify the name.

svn path=/trunk/; revision=8644
2001-03-12 20:31:56 +00:00
21ab381600 Remove our X-Evolution header before we send. Also don't send messages
2001-03-10  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (send_queue_send): Remove our X-Evolution header
	before we send. Also don't send messages that are marked for
	deletion.

svn path=/trunk/; revision=8630
2001-03-11 20:18:56 +00:00
21a546759f Remove our X-Evolution header before we send.
2001-03-10  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (send_queue_send): Remove our X-Evolution header
	before we send.

svn path=/trunk/; revision=8625
2001-03-11 03:42:11 +00:00
e5fbbdf9c1 If the folderinfo has no URL (ie, can't contain messages), don't add it as
* mail-ops.c (get_folderinfo_got): If the folderinfo has no URL
	(ie, can't contain messages), don't add it as a vtrash source.

svn path=/trunk/; revision=8569
2001-03-06 17:20:51 +00:00
b0b0cfe95d Changed the product string - will change it to use User-Agent once I get
2001-02-26  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (mail_send_message): Changed the product string -
	will change it to use User-Agent once I get the RFC/DRUMS draft or
	whatever. Until then I'll stick with User-Agent.

svn path=/trunk/; revision=8395
2001-02-26 20:40:36 +00:00
1f84ac2916 Toss the mail_tool_camel_lock* stuff. Same. Here too.
2001-02-24  Jeffrey Stedfast  <fejj@ximian.com>

	* folder-browser.c: Toss the mail_tool_camel_lock* stuff.
	* mail-ops.c: Same.
	* mail-summary.c: Here too.

	* mail-tools.c (mail_tool_uri_to_folder_noex): Blown away!
	(mail_tool_filter_get_folder_func): *kapoosh*
	(mail_tool_camel_lock_up): Same.
	(mail_tool_camel_lock_down): Same.
	(mail_tool_set_uid_flags): Don't need this rubbish anymore either.

svn path=/trunk/; revision=8384
2001-02-24 21:57:23 +00:00
0ce50d4fdc No longer need to construct the vTrash here. (owner_set_cb): Don't make
2001-02-24  Jeffrey Stedfast  <fejj@ximian.com>

	* component-factory.c (mail_load_storages): No longer need to
	construct the vTrash here.
	(owner_set_cb): Don't make the vTrash for the local store here.

	* mail-ops.c (add_vtrash_info): New function to add a vTrash
	folder info to a pre-constructed CamelFolderInfo for use in the
	get_folder_info async function.

svn path=/trunk/; revision=8381
2001-02-24 20:08:43 +00:00
ac97d963b0 No longer need to do a vtrash_cleanup() (it also doesn't exist anymore).
2001-02-23  Jeffrey Stedfast  <fejj@ximian.com>

	* main.c (main): No longer need to do a vtrash_cleanup() (it also
	doesn't exist anymore).

	* component-factory.c (mail_load_storages): Updated to use the new
	vtrash code.
	(owner_set_cb): Same.

	* mail-tools.c (mail_tool_uri_to_folder): Update to handle the
	"vtrash:" url prefix so that we can extract the REAL uri and know
	to get the trash folder.

	* mail-vtrash.c (mail_vtrash_add): Add the vTrash folder to the
	EvolutionStorage.
	(mail_vtrash_create): Get the store based on the uri (async) and
	then call mail_trash_add.
	(vtrash_cleanup): Removed.
	(vtrash_uri_to_folder): Removed.
	(vtrash_create): Replaced by mail_vtrash_create()

svn path=/trunk/; revision=8367
2001-02-23 16:51:45 +00:00
351903ad90 Make op cancellable/report internals. (get_folder_get):
2001-02-23  Not Zed  <NotZed@Ximian.com>

        * mail-ops.c (create_folder_get): Make op cancellable/report
        internals.
        (get_folder_get):
        (sync_folder_sync):
        (get_folderinfo_get): Make op cancellable/report internals.

        * mail-vtrash.c (get_trash_get): Setup the operation registration,
        and create a pseudo "start/stop" operation.

        * component-factory.c (owner_set_cb): Make trash creation async.

        * mail-local.c (register_folder_desc): A description of what we're
        doing.

        * mail-mt.c (mail_msg_new): Set status callback to operation_new.
        (mail_operation_status): Operation status function, proxy messages
        to main thread, and attempt to present a meaningful ui experience
        for operations.

svn path=/trunk/; revision=8351
2001-02-22 22:27:40 +00:00
473ffc5eee Updated to reflect changes to the filter-driver code.
2001-02-22  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (mail_send_message): Updated to reflect changes to
	the filter-driver code.

svn path=/trunk/; revision=8347
2001-02-22 16:31:31 +00:00
0f2a13586b Fix for api changes to append_mail.
2001-02-21  Not Zed  <NotZed@Ximian.com>

        * mail-callbacks.c (composer_postpone_cb): Fix for api changes to
        append_mail.

        * Makefile.am (evolution_mail_SOURCES): Removed mail-threads.[ch].

        * mail-threads.[ch]: Removed.

        * subscribe-dialog.c (subscribe_do_get_store): Chagned to use new
        thread stuff.  This is really getting boring.
        (subscribe_do_subscribe_folder): Changed to use new thread stuff.
        Last one at last, phew.

        * session.c (register_callback): Changed to use new thread stuff.
        YUCK.  I dropped some functionality, now the timeout callback
        return is ignored, so basically it keeps running till finished.

        * mail-ops.c (mail_operation_run): Removed, no longer used/needed.
        (mail_do_append_mail): Changed to use new thread stuff.
        (mail_do_transfer_messages): ditto.

        * mail-local.c (local_storage_new_folder_cb): Use new thread
        stuff, also only run synchronous for this operation.
        (mail_local_reconfigure_folder):
        (reconfigure_clicked): Changed to use new mail thread stuff.

        * mail-config.c (mail_config_check_service): Changed to use new
        thread stuff.

svn path=/trunk/; revision=8314
2001-02-21 02:19:26 +00:00
63f1ba7ab1 New handy dandy function to ref and return the vfolder storage (will
2001-02-19  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-vfolder.c (mail_vfolder_get_vfolder_storage): New handy
	dandy function to ref and return the vfolder storage (will
	probably be disavowed once I figure out how to get the vTrash
	folder to show up in the EvolutionLocalStorage).

	* main.c (main): Call vtrash_cleanup().

	* mail-vtrash.c: New file.
	(vtrash_uri_to_folder): vtrash: URI handler
	(vtrash_create): Replacement async vtrash function for the old one
	in mail-ops.c
	(vtrash_cleanup): Cleanup code - unrefs the cached vtrash folders
	and free's the hashtable.

	* Makefile.am: Added mail-vtrash.[c,h].

	* mail-tools.c (mail_tool_uri_to_folder): If we have a vtrash:
	URI, call the vtrash URI handler function rather than continuing
	on. Yes, I know this is a hack and it needs to be fixed.

	* mail-ops.c (mail_do_setup_trash): Removed.
	(mail_trash_get): Removed.

	* component-factory.c (owner_set_cb): Create the vTrash folder for
	the LocalStore here.

	* mail-local.c (get_folder_info): Implement.

svn path=/trunk/; revision=8288
2001-02-19 23:38:53 +00:00
d6a9790072 Unref the driver here, in the subthread, so we dont block the gui while it
2001-02-20  Not Zed  <NotZed@Ximian.com>

        * mail-ops.c (fetch_mail_fetch): Unref the driver here, in the
        subthread, so we dont block the gui while it sync's all the
        folders.
        (fetch_mail_fetched): Rewmoved above code from here.

svn path=/trunk/; revision=8278
2001-02-19 21:41:51 +00:00
7ac8a9c5e8 Use mail_storage_create_folder
2001-02-15  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (do_scan_subfolders): Use mail_storage_create_folder

	* mail-callbacks.c (mail_storage_create_folder): Convenience
	function so we can keep all the evolution_storage_add_new_folder()
	code in one place as much as possible.

	* subscribe-dialog.c (recursive_add_folder): Use 'name' rather
	than the no-description bs since that's what all the other places
	do.

	* mail-callbacks.c (folder_created): New callback to handle the
	"folder_created" signal - handles CamelFolderInfo's recursively.
	(folder_deleted): Same but for "folder_deleted".

	* component-factory.c (storage_create_folder): Instead of doing
	the evolution_storage_new_folder() stuff by hand, pass it off to
	the new callback: folder_created(). At some point this will be
	unecessary as we'll attach this callback to the "folder_created"
	signal.

svn path=/trunk/; revision=8247
2001-02-15 23:54:16 +00:00
5ef8138ee8 Setup the Trash folder.
2001-02-14  Jeffrey Stedfast  <fejj@ximian.com>

	* component-factory.c (owner_set_cb): Setup the Trash folder.

	* mail-ops.c (create_trash_vfolder): Do better error handling.
	(populate_folder_urls): Oops, helps to strdup the url into the
	array if we plan on freeing the data.
	(mail_get_trash): New async function that may eventually replace
	mail_do_setup_trash().
	(do_setup_trash): Do better error handling.

	* mail-local.c (mail_local_store_class_init): Override
	get_folder_info.
	(get_folder_info): Implement.

svn path=/trunk/; revision=8228
2001-02-14 21:33:58 +00:00
7004fae0eb Don't leak memory. (forward_messages): change doinline to be a gboolean
2001-02-11  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-callbacks.c (forward_inlined): Don't leak memory.
	(forward_messages): change doinline to be a gboolean argument.

svn path=/trunk/; revision=8172
2001-02-11 07:00:07 +00:00
896d495a2a Reworked some keep-mail-on-server logic so that we ALWAYS look for a
2001-02-08  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (fetch_mail_fetch): Reworked some keep-mail-on-server
	logic so that we ALWAYS look for a cached array of UIDs that we
	may have downloaded previously so as not to download them again
	even if we will be deleting them off the server. This fixes bug
	#1344.

svn path=/trunk/; revision=8135
2001-02-09 02:21:18 +00:00
cd101b3ffc only free driver, if set. (fetch_mail_fetched): Unref the driver here, so
2001-02-09  Not Zed  <NotZed@Ximian.com>

        * mail-ops.c (filter_folder_free): only free driver, if set.
        (fetch_mail_fetched): Unref the driver here, so it can cleanup
        before we call the 'done' callback.

        * component-factory.c (owner_set_cb): Add setup for mail
        autoreceive stuff.

        * mail-send-recv.c (free_info_data): Free the send info's from teh
        active hash, not the running list.
        (receive_done): As we finish downloads, remove them and clean them
        up, and also close the window.
        (mail_autoreceive_setup): New function to setup & maintain
        automatic download stuff.

svn path=/trunk/; revision=8134
2001-02-09 01:48:04 +00:00
4459154549 Handle internal camel status return. (receive_done): Remove active
2001-02-07  Not Zed  <NotZed@Ximian.com>

        * mail-send-recv.c (operation_status): Handle internal camel status return.
        (receive_done): Remove active download when done.
        (mail_receive_uri): Initiate download of a single source, with no gui.
        (build_dialogue): Mark any new items as real active downloads.
        (do_show_status): Make the progress bar optional.

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

        * mail-send-recv.c: camel_cancel->camel_operation.

        * mail-ops.old.c: camel_cancel->camel_operation.

        * mail-ops.c: camel_cancel->camel_operation.

        * mail-mt.c: camel_cancel->camel_operation.

        * mail-callbacks.c (stop_threads): camel_cancel->camel_operation.

        * mail-mt.h: CamelCancel->CamelOperation.

svn path=/trunk/; revision=8096
2001-02-08 01:45:37 +00:00
171de13904 Cast the camel_stream_mem_new() to a CamelStreamMem.
2001-01-29  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-importer.c (mail_importer_add_line): Cast the
	camel_stream_mem_new() to a CamelStreamMem.

svn path=/trunk/; revision=7905
2001-01-30 03:51:20 +00:00
aad4202594 Debug function to compare the tree we think we have, after an incremental
2001-01-29  Not Zed  <NotZed@Ximian.com>

        * message-list.c (tree_equal): Debug function to compare the tree
        we think we have, after an incremental update.
        (build_tree): Check the tree after we've built it.

        * mail-mt.c (mail_get_password): If we are being called from the
        main gui thread, then just call the dialogue directly.  Ideally we
        dont want this anyway but lets handle the case nicely.
        (mail_get_password): Try locking around the password request, to
        single-queue any password requests.
        (mail_msg_init): Push an exit handler to clean it up on completion.

        * mail-send-recv.c (receive_update_got_store): New function called
        when the store has been retrieved asynchronously.
        (mail_send_receive): Get the store asynchronously.  This was
        causing problems where the password dialogue would try and be
        called from the main thread via a message.

        * mail-ops.c (mail_get_store): New function to get a store
        (a)synchronously.  More or less taken from subscribe-dialog, which
        i will remove later.
        (mail_scan_subfolders): Try running the scan subfolder thing
        asynchronously, to help startup time.  Not sure if this will work,
        but presumably the shell can handle the folders appearing later
        ok.

svn path=/trunk/; revision=7886
2001-01-29 09:33:15 +00:00
d8c95a55bc Changed to use mail_save_part to save the data in another thread.
2001-01-28  Not Zed  <NotZed@Ximian.com>

        * mail-display.c (write_data_to_file): Changed to use
        mail_save_part to save the data in another thread.
        (save_data_cb): Hide the fileselector once we have a button press,
        and are saving stuff.

        * mail-ops.c (mail_save_part): New function to save a part content
        asynchronously.

svn path=/trunk/; revision=7867
2001-01-28 03:53:08 +00:00
9987f05606 Set the default folder when copying to mbox. This is a quick fix, i might
2001-01-24  Not Zed  <NotZed@Ximian.com>

        * mail-ops.c (fetch_mail_fetch): Set the default folder when
        copying to mbox.  This is a quick fix, i might need to do a slight
        redesign to clean it up.

svn path=/trunk/; revision=7759
2001-01-23 22:52:03 +00:00
e40e98e0f8 s/filter-driver.h/camel-filter-driver.h/ and update first arg of
* mail-tools.h: s/filter-driver.h/camel-filter-driver.h/ and
	update first arg of mail_too_filter_get_folder_func

	* mail-tools.c (mail_tool_filter_get_folder_func): Update first
	arg to CamelFilterDriver *

	* mail-send-recv.c (receive_status):
	* mail-ops.c (send_queue_send): s/FILTER/CAMEL_FILTER/

	* mail-callbacks.c: Remove filter-driver.h include

	* mail-accounts.c: Put the news functions inside #ifdef
	ENABLE_NNTP to prevent warnings about unused statis functions.

	* subscribe-dialog.c (subscribe_folders, unsubscribe_folders,
	subscribe_refresh_list): Update prototype to match BONOBO_UI_VERB.
	(populate_store_list): add a de-constifying cast

svn path=/trunk/; revision=7708
2001-01-22 17:47:28 +00:00
88f9e36086 remove a warning with conditional news compilation.
2001-01-22  Not Zed  <NotZed@Ximian.com>

	* component-factory.c (owner_set_cb): remove a warning with
	conditional news compilation.

	* mail-ops.h: Cleaned up the header list.

	* folder-browser-factory.c: Replace the old get_send mail with the
	new one (button).

	* mail-ops.c (set_x_mailer):
	(mail_load_evolution_rule_context):
	(mail_do_fetch_mail):
	(mail_do_filter_ondemand):
	(mail_send_mail_old):
	(mail_do_send_queue): All removed, (for) now lives in mail-send-recv.c.
	(load_context):
	(setup_filter_driver):
	(filter_get_folder):
	(mail_filter_folder):
	(mail_fetch_mail):
	(mail_update_subfolders):
	(mail_send_mail):
	(mail_send_queue): New equivalents of all these fundtions, moved
	from mail-send-recv.c ...
	(mail_filter_on_demand): Moved here too.
	(mail_load_filter_context): Export this.

	* mail-callbacks.c (apply_filters): Use the new
	mail_filter_on_demand() call.
	(send_receieve_mail): Use mail_send_receive to do the work.  Add a
	little error handling here that used to be elsewhere.
	(send_queued_mail): Removed.
	(fetch_mail): Removed.
	(select_first_unread): #ifdef'd this out.  Not sure if this still
	makes sense, but it doesn't get run right now anyway.
	(composer_postpone_cb): Fix the setting of message flags.  You
	dont need to get them first, ever.

	* mail-send-recv.c (mail_send_message): Dont use
	mail_tool_send_via_transport anymore (it does nothing useful).

	* mail-tools.c (mail_tool_camel_lock_up): Turned into a noop.
	(mail_tool_camel_lock_down): And here too.
	(mail_tool_move_folder_contents): Removed from the code (hasn't
	bene used for ages).
	(mail_tool_send_via_transport): Removed, it doesn't save anything.

svn path=/trunk/; revision=7702
2001-01-22 11:43:18 +00:00
2679830e64 Remove the X-Evolution header before we send.
2001-01-21  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (do_send_queue): Remove the X-Evolution header before
	we send.

svn path=/trunk/; revision=7689
2001-01-21 23:15:50 +00:00
50ef085e18 Init a cancel field in the message. (mail_msg_free): Free it.
2001-01-21  Not Zed  <NotZed@Ximian.com>

        * mail-mt.c (mail_msg_new): Init a cancel field in the message.
        (mail_msg_free): Free it.
        (mail_msg_cancel): New function to attempt to cancel an
        operation by id.  Impelementation functions can still be
        uncancellable by not registering for cancellation, etc, or do it
        themselves as well.

        * mail-send-recv.c (fetch_mail_filter_folder): set folder_uid's
        properly, so we can save it later.
        (filter_folder_filter): Renamed from fetch_mail_filter_folder,
        since its going to be used for all filtering.
        (mail_fetch_mail): Changed from mail_filter_mail.
        (mail_filter_folder): New function, replaces
        mail_do_filter_ondemand functionality.
        (mail_filter_on_demand): New function, actually replaces
        mail_do_filter_ondemand.
        (receive_get_folder): Added an exception arg.
        (mail_send_message): New function to just send a message.
        (send_mail_send): Use mail_send_message.
        (send_queue_send): New send qeue code, use mail_send_message, and
        clean up some stuff.
        (mail_send_receive): Changed from mail_receive.
        (build_dialogue): Setup the sending data, as well.
        (mail_update_subfolders): New function to update folder info.
        (send_mail_send): hook into cancellation if we want.

svn path=/trunk/; revision=7672
2001-01-21 04:19:30 +00:00
93bd7f1d38 Strip leading space from the transport url gotten from the message.
2001-01-20  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (do_send_queue): Strip leading space from the
	transport url gotten from the message.

svn path=/trunk/; revision=7670
2001-01-21 01:01:31 +00:00
3a51f7793e Replace --with-x-mailer' with a more generic --with-sub-version'.
The value you provide is now also displayed in the shell title bar.
And while I was at it, I changed the title bar so that it displays the
name of the folder first (instead of "Evolution - Inbox" it says
"Inbox - Evolution 0.8 [yaddayadda]").

svn path=/trunk/; revision=7585
2001-01-17 17:29:14 +00:00
9180a6949f If the user hits "No", then don't destroy the filesel window.
2001-01-16  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-callbacks.c (save_msg_ok): If the user hits "No", then
	don't destroy the filesel window.

	* mail-ops.c (save_messages_save): Open with mode 0666 as danw
	suggests.

svn path=/trunk/; revision=7553
2001-01-16 23:21:28 +00:00
83f1dbfe4d Update the X-Mailer header to use the string specified by configure.
* mail-ops.c (send_mail_send, do_send_queue): Update the X-Mailer
	header to use the string specified by configure.

svn path=/trunk/; revision=7540
2001-01-16 19:43:57 +00:00
67be94cbd5 Setup a cancellation handle. (do_fetch_mail): REgister for cancellation
2001-01-16  Not Zed  <NotZed@Ximian.com>

        * mail-ops.c (mail_do_fetch_mail): Setup a cancellation handle.
        (do_fetch_mail): REgister for cancellation here.
        (cleanup_fetch_mail): And unregister for cancellation here.
        (mail_get_message): Add a cancel handle.
        (get_message_get): Register/deregister for cancel.
        (get_message_free): & clean up.

        * mail-mt.c (mail_msg_received): Removed debuggng.

        * mail-callbacks.c (stop_threads): Callback for stopping.

        * folder-browser-factory.c: Add a stop button verb thingy.
        (control_activate): Disable the stop button by default.

svn path=/trunk/; revision=7527
2001-01-16 03:57:24 +00:00
f88c5b4073 Get the X-Evolution-Transport URL and use that if it exists, else fall
2001-01-13  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-ops.c (do_send_queue): Get the X-Evolution-Transport URL
	and use that if it exists, else fall back on the default
	transport.

	* mail-callbacks.c (composer_postpone_cb): Set an
	X-Evolution-Transport header.

svn path=/trunk/; revision=7474
2001-01-13 05:59:32 +00:00
ae70268af9 Let the system umask determine the permissions of this file.
2001-01-09  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-ops.c (save_messages_save): Let the system umask determine
	the permissions of this file.

svn path=/trunk/; revision=7341
2001-01-09 21:48:23 +00:00
5670e3e662 Add an #include <errno.h>
* mail-ops.c: Add an #include <errno.h>

svn path=/trunk/; revision=7308
2001-01-08 22:05:20 +00:00
f4f3ede9d3 Removed old implementation.
2001-01-04  Not Zed  <NotZed@HelixCode.com>

	* mail-ops.c (mail_do_send_mail): Removed old implementation.

	* folder-browser.c (do_message_selected): If we haven't got a real
	uid, then clear the display instead.

	* message-list.c (message_list_drag_data_get): Use new save
	message function, and also wait for it to finish before
	continuing.
	(folder_changed):
	(message_changed): Use mail_proxy_event instead of
	mail_do_forward.
	(mail_regen_list): New iplementation to replace the old.
	: remove <gnome.h> from headers.  Dont define timeit by default.
	(main_folder_changed):
	(message_list_set_folder):
	(message_list_set_threaded):
	(message_list_set_search):
	(message_list_hide_add):
	(message_list_hide_uids):
	(message_list_hide_clear): Use mail_regen_list instead of
	mail_do_regenerate_messagelist.
	(mail_do_regenerate_messagelist): Removed the old stuff.  No
	functionality changed yet, just using different thread stuff.

	* mail-callbacks.c (save_msg_ok): Use new save message function.

	* component-factory.c (create_view):
	(add_storage): Use mail_scan_subfolders to build the folder info.
	(create_folder): Use new implementation with our own callback.
	(owner_set_cb): Changed b ack to use mail_get_folder, but now wait
	for it to finish.  This will let any gui still run, but also gives
	us the required synchronous operation.
	(got_folder): Callback for when the folder has been opened.

	* mail-ops.c (mail_get_folderinfo): New function to just get the
	folder info in another thread.
	(mail_scan_subfolders): New scan subfolder implementation that
	uses mail_get_folderinfo.
	(mail_do_scan_subfolders): Removed old implementation.
	(mail_create_folder): Nerw implementation to create a folder, only.
	(mail_do_create_folder): Removed old implementation.
	(mail_save_messages): New implementation, fixes a couple of minor
	problems, and now provides a return so it can be waited on.  Also
	check that the writes worked, etc.
	(mail_do_save_messages): Remove previous implementation.
	(mail_do_flag_messages): Removed, nothing uses it.
	(mail_do_flag_messages): Removed, nothing uses it anymore.
	(mail_get_folder): REturn the operation id, so callers can wait
	for it.
	(sync_folder_desc):
	(expunge_folder_desc): Add describe functions so we know what its
	doing.
	(mail_send_mail): More generic implementation of sending mail.

	* mail-mt.c (mail_msg_new): Lock around seq increment.  And insert
	each new message into a hash table of active messages.
	(mail_msg_init): Init the active message table.
	(mail_msg_free): Remove the message from the active message table.
	(mail_msg_wait): New function, waits for a message to be
	processed, by id.
	(mail_msg_check_error): Dont display the error if it is a
	user-cancelled operation.
	(mail_proxy_event): new implementation of mail_op_forward_event.
	Only real difference is it uses the new	thread stuff, and you can
	wait for it to finish if you want.
	(mail_proxy_event): If we're already in the main thread, just call
	the function.

svn path=/trunk/; revision=7246
2001-01-04 07:34:26 +00:00
c37da13423 Call mail-callbacks.c:forward_messages(), so the behaviour is the same as
2001-01-03  Not Zed  <NotZed@HelixCode.com>

        * mail-view.c (view_forward_msg): Call
        mail-callbacks.c:forward_messages(), so the behaviour is the same
        as from the folder browser.

        * mail-callbacks.c (forward_messages): New function to forward
        messages, attached or not.
        (forward_inlined): Changed to use new forward-messages
        implementation.
        (forward_attached): Likewise.
        (do_forward_attach): Callback for forwarding as attachment, once
        we have built it.
        (do_forward_inline): Likewise, for inline, once we have retrieved
        the message.
        (forward_message): Removed.

        * mail-ops.c (mail_build_attachment): New function to build an
        attachment of messages.
        (mail_do_attach_message): Removed, functionality superceeded by
        above.
        (mail_do_forward_message): Removed.  Likewise.
        (mail_create_folder): Started work on an alternative
        implementation of create_folder, but not sure about it yet.

        * mail-tools.c (mail_tool_generate_forward_subject): Remove locking.
        (mail_tool_make_message_attachment): Free the description when done.

svn path=/trunk/; revision=7232
2001-01-03 11:52:04 +00:00
a16344fff4 Fix for mail_get_message change, use queue thread.
2001-01-02  Not Zed  <NotZed@HelixCode.com>

	* mail-callbacks.c (view_msg): Fix for mail_get_message change,
	use queue thread.

	* folder-browser.c (done_message_selected): Fix mail_Get_message
	calls, use new thread.
	(do_message_selected): "

	* mail-ops.c (mail_get_message): Add a thread argument so callers
	can specify which queue it executes on.

	* mail-mt.c (mail_msg_free): Fix a free order problem.
	(mail_msg_destroy): Call mail_msg_free to do the work.
	(mail_msgport_replied): "
	(mail_msgport_replied): Check/display errors if we get them.
	(mail_msgport_received): If we have a describe function, say what
	we're doing, also set busy/unbusy.
	(mail_msgport_replied): Clear busy when we get a reply.
	(mail_get_password): Unset busy.
	(mail_msg_received): Set busy as we go.
	(mail_msg_destroy): Unset busy when done.
	(mail_status): Blah blah, new status interface, the other wans't
	workable with the way the shell api works.

2000-12-29  Not Zed  <NotZed@HelixCode.com>

	* folder-browser.c (do_message_selected): If we are reconfiguring,
	just keep polling till we are done (yeah kinda shitty, but easy).
	(folder_browser_set_uri): Clear reconfigure flag here.  ick.
	(got_folder): And here too.
	(on_right_click): Remove locking.
	(hide_sender): and here too.
	(hide_subject): And here.
	(on_right_click): If we are in reconfigure, then the whole menu is disabled.

	* mail-mt.c (status_busy_timeout): Clear the status_busy_timeout_id.

	* mail-local.c (local_storage_new_folder_cb): Made getting folders
	completely synchronous.  The shell expects it, and it was only
	synchronous before by a sideeffect.
	(do_reconfigure_folder): Remove locking stuff.
	(do_reconfigure_folder): Use our own much simpler copying routine
	than that stupid move_folder_contents thing.
	(update_progress): Use mail_status_message() instead.
	(do_reconfigure_folder): Set the reconfigure flag during
	reconfigure & set busy flag.
	(cleanup_reconfigure_folder): clear busy flag.

	* mail-tools.c (mail_tool_uri_to_folder): Remove the tool_lock
	stuff.
	(mail_tool_uri_to_folder_noex): Clear exception on exit.
	(mail_tool_move_folder_contents): Get rid of this really stupid
	function that is only used in one place.

	* component-factory.c (owner_set_cb): Use direct calls to get the
	folders, as this code must run synchronous.  Remove the event wait
	stuff.

	* mail-callbacks.c (edit_msg): Call mail_get_messages, and create
	the composers ourself.
	(do_edit_messages): get_messages callback, create the composers
	and connect to signals we need.
	(view_msg): Dont call do_view_messages, just call
	mail_get_messge for each to get them in parallel.
	(do_view_message): view a single message.

	* mail-ops.c (mail_edit_messages): Just use mail_get_messages
	for this operation.  Removed the other async operation stuff.
	Changed my mind, just removed entirely.
	(mail_do_view_messages): Removed.
	(mail_do_setup_folder): Removed.
	(mail_do_scan_subfolders): Make this run synchronously, as every
	caller expects it to (even if they didn't realise).

2000-12-28  Not Zed  <NotZed@HelixCode.com>

	* mail-callbacks.c (send_queued_mail): Dont expunge the folder
	here, but in send_queue, otherwise it might execute out of order.
	(expunge_folder): Remove the talbe prechange stuff, and infact
	references to the message_list folder, as we have our own folder.
	Also, dont allow expunge if we're already expunging.
	(expunged_folder): Clkear the expunging flag if we're finished.

	* folder-browser-factory.c (control_deactivate): Likewise here.
	Hrm, i thought this function required a callback, silly me.

	* mail-tools.c (mail_tool_make_message_attachment): Remov e
	locking.

	* folder-browser.c (on_message_selected): Use a timeout handler so
	we dont select immediately.
	(folder_browser_set_uri): Changed to use mail_get_folder.
	(got_folder): New callback called when get_folder is finished.
	(folder_browser_destroy): Use new sync interface.

	* mail-ops.c (mail_get_message): New function to asynchrounously
	get a message.
	: #define out mail_tool_camel_lock stuff entirely.
	(mail_get_folder): New function to asynchrounously get a folder.
	(mail_do_load_folder): Removed, replaced by more generic function
	above.
	(mail_do_display_message): Removed, replaced by the more generic
	funciton get_message.
	(mail_get_messages): New function to get a list of messages
	asynchronously.
	(mail_sync_folder): New interface to sync a folder async.
	(mail_expunge_folder): New interface for expunging folder, with
	callback.
	(do_send_queue): Remove lock stuff, and expunge if (and only if)
	successful, also sync the sent folder while we're at it.

	* session.c (mail_session_request_dialog): Changed to use new
	mail_get_password call.

	* mail-mt.[ch]: New threading/interthread messaging framework.

	* main.c (main): Init the message/thread system.

svn path=/trunk/; revision=7223
2001-01-03 01:18:21 +00:00
7f77a607ea fixed unresolved symbol (d)
svn path=/trunk/; revision=7207
2001-01-02 00:56:09 +00:00
161d88eee6 Implemented.
2000-12-26  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-crypto.c (mail_crypto_openpgp_verify): Implemented.

2000-12-23  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-ops.c (mail_do_setup_trash): New function similar to
	mail_do_setup_folder() except that this creates the Trash VFolder
	(special-case).

2000-12-21  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-ops.c (do_send_mail): Don't free info inside the last
	if-statement, if sent_folder doesn't exist we'll have a memory
	leak. Instead free it afterward.

svn path=/trunk/; revision=7205
2001-01-01 23:19:54 +00:00
fba04bdda7 Merge from camel-mt-branch.
2000-12-24  Not Zed  <NotZed@HelixCode.com>

        * Merge from camel-mt-branch.

svn path=/trunk/; revision=7153
2000-12-24 01:03:14 +00:00
d89c235bc7 Only update display every 2 seconds.
2000-12-18  Miguel de Icaza  <miguel@helixcode.com>

	* mail-tools.c (mail_tool_move_folder_contents): Only update
	display every 2 seconds.

	* mail-ops.c (do_view_messages): Only update display every 2 seconds.

svn path=/trunk/; revision=7066
2000-12-18 06:49:02 +00:00
045479b2a4 Deal with "mailstorage" type views (top-level mail storages) by trying to
* component-factory.c (create_view): Deal with "mailstorage" type
	views (top-level mail storages) by trying to fill the storage's
	folder tree again if we failed before.
	(add_storage): Create new storages with a URI and type
	"mailstorage".

	* mail-ops.c (cleanup_scan_subfolders): On success, mark the
	storage as having been loaded, so create_view won't try again.

svn path=/trunk/; revision=6923
2000-12-11 23:17:46 +00:00
ccbbf69f50 clean up the cleanup a bit
* mail-ops.c (do_flag_messages): clean up the cleanup a bit

svn path=/trunk/; revision=6906
2000-12-11 16:41:03 +00:00
c65fda0e89 Check to see if the file already exists, if it does prompt the user to for
2000-12-08  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-callbacks.c (save_msg_ok): Check to see if the file already
	exists, if it does prompt the user to for permission to overwrite
	the file.
	(forward_message): g_strdup the cursor_uid if there is only a
	single message to be forwarded or we'll segfault later.

	* mail-ops.c (do_save_messages): Rewrote yet again. I'm back to
	almost an identical implementation as the first time I wrote this
	except now we write the From line which I had forgotten last
	time. This means that we no longer have to unlink the .ev-summary
	file created and we also use fewer resources (no need to create a
	CamelMboxFolder object).

svn path=/trunk/; revision=6882
2000-12-09 02:09:56 +00:00
cec18e26aa Only do a message_list_foreach if we plan on attaching messages, otherwise
2000-12-07  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-callbacks.c (forward_message): Only do a
	message_list_foreach if we plan on attaching messages, otherwise
	just use ml->cursor_uid.

	* mail-ops.c (cleanup_forward_messages): If attaching multiple
	forwarded message, wrap them in a multipart/digest otherwise just
	attach the single message as a message/rfc822.

svn path=/trunk/; revision=6851
2000-12-07 23:41:59 +00:00
5c7218c629 Remove bits of filter-on-demand and toolbar bug workaround cruft that
* folder-browser.c: Remove bits of filter-on-demand and toolbar
	bug workaround cruft that don't do anything useful any more.

	* mail-ops.c (cleanup_load_folder): unref the ref we added in
	setup_load_folder.

svn path=/trunk/; revision=6812
2000-12-06 18:40:11 +00:00
2063939db4 use mail_op_set_message_plain
2000-12-01  Radek Doulik  <rodo@helixcode.com>

	* mail-ops.c (mail_op_report_status): use mail_op_set_message_plain

	* mail-threads.c (mail_op_set_message_plain): plain version of
	mail_op_set_message, doesn't use printf, passes message untouched,
	use set_message
	(mail_op_set_message): set_message
	(set_message): helper function

svn path=/trunk/; revision=6753
2000-12-01 08:19:16 +00:00
8fa85c39e5 Don't display a dialog, instead inform the user that there was no new mail
2000-11-30  Jeffrey Stedfast  <fejj@helixcode.com>

	* mail-ops.c (cleanup_fetch_mail): Don't display a dialog, instead
	inform the user that there was no new mail by setting a status
	message.

	* message-list.c (message_list_drag_data_get): Use the new
	e_str_make_safe function.

	* mail-display.c (make_safe_filename): And here.

	* mail-config.c (mail_config_folder_to_cachename): Here too.

svn path=/trunk/; revision=6745
2000-11-30 22:44:00 +00:00
9b49b3e25a Set threaded view before setting the folder (cleanup some flash ons
2000-11-30  Not Zed  <NotZed@HelixCode.com>

	* mail-ops.c (cleanup_load_folder): Set threaded view before
	setting the folder (cleanup some flash ons tartup).

	* message-list.c (message_list_init): Initialise a mempool for uid
	string storage.
	(new_id_from_uid): Added messagelist arg, allocate strings from
	uid_pool.
	(new_id_from_subject): Same.  Fixed all callers.
	(remove_node_diff): Dont free uid here.
	(build_flat_diff): Nor here.
	(clear_tree): Flush the mempool, rather than freeing the id's
	directly.
	(free_tree_ids): Removed, no longer required.
	(free_tree_ids): Likewise.
	(message_list_init): Dont connect to the table destroy signal
	anymore to free the uid table.
	(message_list_destroy): Free the uid pool here.
	(*): Use accessors for messageid stuff.
	(content_is_attachment): Removed, no longer required.
	(ml_tree_value_at): Get the attachment flag directly from the
	summary.
	(ml_tree_value_at): For 'fake' nodes, try and do something better
	than "?" for from, to, and size.
	(subtree_size): New function, add up the total size of a subtree.
	(subtree_earliest): Get the earliest date from a subtree.
	(ml_tree_value_at): Return earliest date sent/received for fake
	nodes.
	(ml_tree_value_at): Return something to mark a fake subject line
	as a fake subject, although i dont know, i guess this buggers up
	sorting ...
	(subtree_size): Check the info node is still there.
	(subtree_earliest): Same here.
	(subtree_unread): And here.  The info node might vanish if the
	folder has changed/is changing and we try and redraw stuff while
	its doing it.
	(message_list_drag_data_get): Use accessors.

svn path=/trunk/; revision=6732
2000-11-30 11:32:50 +00:00