diff options
author | Sankar P <psankar@novell.com> | 2005-05-07 14:27:22 +0800 |
---|---|---|
committer | Sankarasivasubramanian Pasupathilingam <psankar@src.gnome.org> | 2005-05-07 14:27:22 +0800 |
commit | 3d6a2b1c38b67cf2d5f86cb81122c6edce8594b9 (patch) | |
tree | 74a18e22d5b0bd3d8274bdc505e23a125073f601 /mail | |
parent | 9dfbde97f536b48d86f269636b2967b114d25380 (diff) | |
download | gsoc2013-evolution-3d6a2b1c38b67cf2d5f86cb81122c6edce8594b9.tar.gz gsoc2013-evolution-3d6a2b1c38b67cf2d5f86cb81122c6edce8594b9.tar.zst gsoc2013-evolution-3d6a2b1c38b67cf2d5f86cb81122c6edce8594b9.zip |
mail-ops.c (mail_send_message) Added code to prevent copying of sent
2005-05-07 Sankar P <psankar@novell.com>
* mail-ops.c (mail_send_message)
Added code to prevent copying of sent items, based on provider type
* em-account-editor.c (emae_defaults_page)
Added code to disable the Sent Folders button
svn path=/trunk/; revision=29310
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/em-account-editor.c | 5 | ||||
-rw-r--r-- | mail/mail-ops.c | 86 |
3 files changed, 56 insertions, 43 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 84d635ba65..1fdd52735e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2005-05-07 Sankar P <psankar@novell.com> + + * mail-ops.c (mail_send_message) + Added code to prevent copying of sent items, based on provider type + + * em-account-editor.c (emae_defaults_page) + Added code to disable the Sent Folders button + 2005-05-06 Not Zed <NotZed@Ximian.com> * mail.error.xml: renamed from mail-errors.xml, add i18n tags, fix diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 56c7b50aad..390f092148 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -2135,9 +2135,10 @@ emae_defaults_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st emae_account_entry(emae, "bcc_addrs", E_ACCOUNT_BCC_ADDRS, xml); gtk_widget_set_sensitive((GtkWidget *)gui->drafts_folder_button, e_account_writable(emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI)); - gtk_widget_set_sensitive((GtkWidget *)gui->sent_folder_button, e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI)); + gtk_widget_set_sensitive((GtkWidget *)gui->sent_folder_button, e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI)&& !(emae->priv->source.provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)); gtk_widget_set_sensitive((GtkWidget *)gui->restore_folders_button, - e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI) + (e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI) && + ! ( emae->priv->source.provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)) || e_account_writable(emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI)); /* Receipt policy */ diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 98de077b36..d66cb5d22a 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -550,21 +550,6 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination, /* post process */ mail_tool_restore_xevolution_headers (message, xev); - if (sent_folder_uri) { - folder = mail_tool_uri_to_folder (sent_folder_uri, 0, ex); - if (camel_exception_is_set(ex)) { - g_string_append_printf (err, _("Failed to append to %s: %s\n" - "Appending to local `Sent' folder instead."), - sent_folder_uri, camel_exception_get_description (ex)); - camel_exception_clear (ex); - } - } - - if (!folder) { - folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT); - camel_object_ref(folder); - } - if (driver) { camel_filter_driver_filter_message (driver, message, info, NULL, NULL, NULL, "", ex); @@ -580,46 +565,65 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination, } camel_exception_clear (ex); - camel_folder_append_message (folder, message, info, NULL, ex); - if (camel_exception_is_set (ex)) { - CamelFolder *sent_folder; - if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) - goto exit; + if (!( ((CamelService *)xport)->provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)) { + if (sent_folder_uri) { + folder = mail_tool_uri_to_folder (sent_folder_uri, 0, ex); + if (camel_exception_is_set(ex)) { + g_string_append_printf (err, _("Failed to append to %s: %s\n" + "Appending to local `Sent' folder instead."), + sent_folder_uri, camel_exception_get_description (ex)); + camel_exception_clear (ex); + } + } - sent_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT); + if (!folder) { + folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT); + camel_object_ref(folder); + } - if (folder != sent_folder) { - const char *name; - - camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (char **) &name, 0); - if (err->len) - g_string_append(err, "\n\n"); - g_string_append_printf (err, _("Failed to append to %s: %s\n" - "Appending to local `Sent' folder instead."), - name, camel_exception_get_description (ex)); - camel_object_ref (sent_folder); - camel_object_unref (folder); - folder = sent_folder; - camel_exception_clear (ex); - camel_folder_append_message (folder, message, info, NULL, ex); - } + camel_folder_append_message (folder, message, info, NULL, ex); if (camel_exception_is_set (ex)) { + CamelFolder *sent_folder; + if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) goto exit; - if (err->len) - g_string_append(err, "\n\n"); - g_string_append_printf (err, _("Failed to append to local `Sent' folder: %s"), + sent_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT); + + if (folder != sent_folder) { + const char *name; + + camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (char **) &name, 0); + if (err->len) + g_string_append(err, "\n\n"); + g_string_append_printf (err, _("Failed to append to %s: %s\n" + "Appending to local `Sent' folder instead."), + name, camel_exception_get_description (ex)); + camel_object_ref (sent_folder); + camel_object_unref (folder); + folder = sent_folder; + + camel_exception_clear (ex); + camel_folder_append_message (folder, message, info, NULL, ex); + } + + if (camel_exception_is_set (ex)) { + if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) + goto exit; + + if (err->len) + g_string_append(err, "\n\n"); + g_string_append_printf (err, _("Failed to append to local `Sent' folder: %s"), camel_exception_get_description (ex)); + } } } - if (!camel_exception_is_set(ex)) camel_folder_set_message_flags (queue, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0); - + if (err->len) { /* set the culmulative exception report */ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, err->str); |