aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mailing-list-actions/mailing-list-actions.c
diff options
context:
space:
mode:
authorMeilof Veeningen <meilof@wanadoo.nl>2004-11-12 13:03:07 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-11-12 13:03:07 +0800
commit55bead18b69fd4e7ad2b09700867add2ca7e9838 (patch)
tree2c03fe202d748564ac9d818559b2a728f3142e15 /plugins/mailing-list-actions/mailing-list-actions.c
parent725dc02affb727219a036f0f51edae33fa249263 (diff)
downloadgsoc2013-evolution-55bead18b69fd4e7ad2b09700867add2ca7e9838.tar.gz
gsoc2013-evolution-55bead18b69fd4e7ad2b09700867add2ca7e9838.tar.zst
gsoc2013-evolution-55bead18b69fd4e7ad2b09700867add2ca7e9838.zip
Added author tag, fixed description, removed "plugin" from name, changed
2004-11-04 Meilof Veeningen <meilof@wanadoo.nl> * org-gnome-mailing-list-actions.eplug.in: Added author tag, fixed description, removed "plugin" from name, changed position of item in popup menu, using "enable" rather than "visible" for bonobo menus * org-gnome-mailing-list-actions.xml: Now place menus in MailMessageActions placeholder; moved label to <commands> section * org-gnome-mailing-list-actions-errors.xml: fixed button order: "Cancel" now leftmost button; added e-mail address to send confirm dialog * mailing-list-actions.c: account guessing now first based on message; added e-mail address to send confirm dialog svn path=/trunk/; revision=27897
Diffstat (limited to 'plugins/mailing-list-actions/mailing-list-actions.c')
-rw-r--r--plugins/mailing-list-actions/mailing-list-actions.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c
index c8fbddb971..c8b0e15ea8 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -95,13 +95,13 @@ void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage
{
emla_action_data *action_data = (emla_action_data *) data;
EmlaAction action = action_data->action;
- const char* header = NULL, *headerpos;
+ const char* header = NULL, *headerpos, *fromurl = NULL;
char *end, *url = NULL;
int t;
GError *err;
EMsgComposer *composer;
int send_message_response;
- EAccount *account;
+ EAccount *account = NULL;
for (t = 0; t < emla_n_action_headers; t++) {
if (emla_action_headers[t].action == action &&
@@ -140,20 +140,29 @@ void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage
url[end-headerpos] = '\0';
if (strncmp (url, "mailto:", 6) == 0) {
- if (emla_action_headers[t].interactive)
+ if (emla_action_headers[t].interactive) {
send_message_response = GTK_RESPONSE_NO;
- else
- send_message_response = e_error_run (NULL, "org.gnome.mailing-list-actions:ask-send-message", url, NULL);
+ } else {
+ fromurl = camel_mime_message_get_source (msg);
+ account = mail_config_get_account_by_source_url (fromurl);
+ if (!account) {
+ fromurl = action_data->uri;
+ account = mail_config_get_account_by_source_url (fromurl);
+ }
+ send_message_response = e_error_run (NULL, "org.gnome.mailing-list-actions:ask-send-message",
+ (account && account->id && account->id->address) ? account->id->address : "(default e-mail)",
+ url, NULL);
+ }
if (send_message_response == GTK_RESPONSE_YES) {
/* directly send message */
composer = e_msg_composer_new_from_url (url);
- if ((account = mail_config_get_account_by_source_url (action_data->uri)))
+ if (account)
e_msg_composer_hdrs_set_from_account ((EMsgComposerHdrs *) composer->hdrs, account->name);
em_utils_composer_send_cb (composer, NULL);
} else if (send_message_response == GTK_RESPONSE_NO) {
/* show composer */
- em_utils_compose_new_message_with_mailto (url, action_data->uri);
+ em_utils_compose_new_message_with_mailto (url, fromurl);
}
goto exit;