diff options
author | Chenthill Palanisamy <pchenthill@novell.com> | 2007-07-09 19:12:07 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-09 19:12:07 +0800 |
commit | d951a60f705e5bf1fc5e2c683155579c2a662486 (patch) | |
tree | 695c333372a3b8b715bea183ccef999c055c5158 /plugins/exchange-operations/exchange-mail-send-options.c | |
parent | 89b64f3d95b7d59b17a563e88ad18d08369ae064 (diff) | |
download | gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.tar gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.tar.gz gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.tar.bz2 gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.tar.lz gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.tar.xz gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.tar.zst gsoc2013-evolution-d951a60f705e5bf1fc5e2c683155579c2a662486.zip |
reviewed by: Veerapuram Varadhan <vvaradhan@novell.com>
2007-07-09 Chenthill Palanisamy <pchenthill@novell.com>
reviewed by: Veerapuram Varadhan <vvaradhan@novell.com>
* exchange-delegates-user.c: (map_to_full_role_name),
(em_utils_delegates_done), (exchange_delegates_user_edit):
* exchange-delegates-user.h:
* exchange-delegates.c: (add_button_clicked_cb),
(edit_button_clicked_cb), (email_look_up), (table_click_cb):
* exchange-delegates.glade:
* exchange-delegates.h:
* exchange-mail-send-options.c: (append_to_header):
* exchange-send-options.c:
(exchange_send_options_get_widgets_data), (get_widgets),
(exchange_send_options_fill_widgets_with_data),
(exchange_send_options_cb), (delegate_option_toggled),
(addressbook_dialog_response), (addressbook_entry_changed),
(address_button_clicked), (exchange_sendoptions_dialog_run),
(exchange_sendoptions_dialog_init):
* exchange-send-options.glade:
* exchange-send-options.h:
* org-gnome-exchange-operations.error.xml: Added the exchange
delegation support.
Committing on behalf of Bharath Acharya <abharath@novell.com>
svn path=/trunk/; revision=33784
Diffstat (limited to 'plugins/exchange-operations/exchange-mail-send-options.c')
-rw-r--r-- | plugins/exchange-operations/exchange-mail-send-options.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/exchange-operations/exchange-mail-send-options.c b/plugins/exchange-operations/exchange-mail-send-options.c index 1a5f7f38f5..3fe9d7f4c1 100644 --- a/plugins/exchange-operations/exchange-mail-send-options.c +++ b/plugins/exchange-operations/exchange-mail-send-options.c @@ -26,9 +26,11 @@ #include <glib/gi18n.h> #include <camel/camel-mime-message.h> +#include <camel/camel-address.h> #include "mail/em-event.h" #include "composer/e-msg-composer.h" +#include "composer/e-msg-composer-hdrs.h" #include "libedataserver/e-account.h" #include "exchange-send-options.h" @@ -41,6 +43,10 @@ static void append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data) { EMsgComposer *composer; + EMsgComposerHdrs *hdrs; + CamelInternetAddress *sender_address; + const char *sender_id, *recipient_id; + composer = (EMsgComposer *)data; if (state == GTK_RESPONSE_OK) { if (dialog->options->importance) { @@ -77,6 +83,44 @@ append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data) } else e_msg_composer_remove_header (composer, "Sensitivity"); + + hdrs = e_msg_composer_get_hdrs (composer); + sender_address = (CamelAddress *) e_msg_composer_hdrs_get_from (hdrs); + sender_id = (const char*) camel_address_encode (sender_address); + + struct _camel_header_address *addr = camel_header_address_decode ( + dialog->options->delegate_address, NULL); + + struct _camel_header_address *sender_addr = camel_header_address_decode ( + sender_id, NULL); + + if(dialog->options->send_as_del_enabled && + dialog->options->delegate_address && + g_ascii_strcasecmp(addr->v.addr, sender_addr->v.addr)) { + + e_msg_composer_modify_header (composer, "Sender" , sender_id); + + /* This block handles the case wherein the address to be added + * in the "From" field has no name associated with it. + * So for cases where there is no name we append the address + * (only email) within angular braces. + */ + if(!g_ascii_strcasecmp (addr->name, "")) { + recipient_id = g_strdup_printf ("<%s>", + dialog->options->delegate_address); + e_msg_composer_add_header (composer, "From", recipient_id); + } + + else + e_msg_composer_add_header (composer, "From", + dialog->options->delegate_address); + } + + + else { + e_msg_composer_remove_header (composer, "Sender"); + e_msg_composer_add_header (composer, "From", sender_id); + } if (dialog->options->delivery_enabled) { EMsgComposerHdrs *hdrs = e_msg_composer_get_hdrs(composer); |