diff options
author | leon.zhang <leon.zhang@sun.com> | 2003-01-24 12:59:36 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-01-24 12:59:36 +0800 |
commit | 09e6aacd2d5af2573cd9640e20df02067231b697 (patch) | |
tree | dc46b022ed5c6a5bfb6f73ae28e7419d512fd33e | |
parent | e296988648aea5a9bbecba60a0266ade7a483d92 (diff) | |
download | gsoc2013-evolution-09e6aacd2d5af2573cd9640e20df02067231b697.tar.gz gsoc2013-evolution-09e6aacd2d5af2573cd9640e20df02067231b697.tar.zst gsoc2013-evolution-09e6aacd2d5af2573cd9640e20df02067231b697.zip |
transfer the current acount info, which will be regarded as the sender of
2002-12-07 leon.zhang <leon.zhang@sun.com>
* component-factory.c (user_create_new_item_cb): transfer the
current acount info, which will be regarded as the sender of
new composer, to send_to_url().
* mail-callbacks.h (send_to_url): Add a new parameter for parent
folder uri.
* mail-callbacks.c (send_to_url): Create composer base on source
account info from parent folder physical uri.
(post_to_url): create composer based on current account from
parent folder physical uri.
* mail-display.c (on_link_clicked): Apply new format of function:
send_to_url.
Fixes bug #35123 #35289
2003-01-24 Not Zed <NotZed@Ximian.com>
* mail-local.c (non_equal): We do actually need to check they are
file url's, otherwise, all url's match.
svn path=/trunk/; revision=19611
-rw-r--r-- | mail/ChangeLog | 24 | ||||
-rw-r--r-- | mail/component-factory.c | 4 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 21 | ||||
-rw-r--r-- | mail/mail-callbacks.h | 2 | ||||
-rw-r--r-- | mail/mail-display.c | 2 | ||||
-rw-r--r-- | mail/mail-local.c | 7 |
6 files changed, 50 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 867748865b..c274b9d337 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,27 @@ +2002-12-07 leon.zhang <leon.zhang@sun.com> + + * component-factory.c (user_create_new_item_cb): transfer the + current acount info, which will be regarded as the sender of + new composer, to send_to_url(). + + * mail-callbacks.h (send_to_url): Add a new parameter for parent + folder uri. + + * mail-callbacks.c (send_to_url): Create composer base on source + account info from parent folder physical uri. + (post_to_url): create composer based on current account from + parent folder physical uri. + + * mail-display.c (on_link_clicked): Apply new format of function: + send_to_url. + + Fixes bug #35123 #35289 + +2003-01-24 Not Zed <NotZed@Ximian.com> + + * mail-local.c (non_equal): We do actually need to check they are + file url's, otherwise, all url's match. + 2003-01-23 Rodney Dawes <dobey@ximian.com> * folder-browser.c (fb_resize_cb): Use button_release instead of diff --git a/mail/component-factory.c b/mail/component-factory.c index 9a2a5e2089..ef655c3d90 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -869,7 +869,7 @@ handle_external_uri_cb (EvolutionShellComponent *shell_component, /* FIXME: Sigh. This shouldn't be here. But the code is messy, so I'll just put it here anyway. */ - send_to_url (uri); + send_to_url (uri, NULL); } static void @@ -880,7 +880,7 @@ user_create_new_item_cb (EvolutionShellComponent *shell_component, gpointer data) { if (!strcmp (id, "message")) { - send_to_url (NULL); + send_to_url (NULL, parent_folder_physical_uri); return; } else if (!strcmp (id, "post")) { post_to_url (parent_folder_physical_uri); diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 8a30ece8cf..7957121f10 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -806,18 +806,22 @@ compose_msg (GtkWidget *widget, gpointer user_data) /* Send according to a mailto (RFC 2368) URL. */ void -send_to_url (const char *url) +send_to_url (const char *url, const char *parent_uri) { struct _composer_callback_data *ccd; GtkWidget *composer; + EAccount *account = NULL; /* FIXME: no way to get folder browser? Not without * big pain in the ass, as far as I can tell */ if (!check_send_configuration (NULL)) return; - /* Tell create_msg_composer to use the default email profile */ - composer = create_msg_composer (NULL, FALSE, url); + if (parent_uri) + account = mail_config_get_account_by_source_url (parent_uri); + + composer = create_msg_composer (account, FALSE, url); + if (!composer) return; @@ -1503,8 +1507,17 @@ post_to_url (const char *url) { struct _composer_callback_data *ccd; GtkWidget *composer; + EAccount *account = NULL; + + /* FIXME: no way to get folder browser? Not without + * big pain in the ass, as far as I can tell */ + if (!check_send_configuration (NULL)) + return; + + if (url) + account = mail_config_get_account_by_source_url (url); - composer = create_msg_composer (NULL, TRUE, NULL); + composer = create_msg_composer (account, TRUE, NULL); if (!composer) return; diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h index cc34c3bbd6..6b2c4573c9 100644 --- a/mail/mail-callbacks.h +++ b/mail/mail-callbacks.h @@ -48,7 +48,7 @@ void fetch_mail (GtkWidget *widget, gpointer user_data); void send_queued_mail (GtkWidget *widget, gpointer user_data); void compose_msg (GtkWidget *widget, gpointer user_data); -void send_to_url (const char *url); +void send_to_url (const char *url, const char *parent_uri); void forward_inline (GtkWidget *widget, gpointer user_data); void forward_quoted (GtkWidget *widget, gpointer user_data); diff --git a/mail/mail-display.c b/mail/mail-display.c index e156f72243..4531555449 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -298,7 +298,7 @@ on_link_clicked (GtkHTML *html, const char *url, MailDisplay *md) { if (!strncasecmp (url, "mailto:", 7)) { - send_to_url (url); + send_to_url (url, NULL); } else if (*url == '#') { mail_display_jump_to_anchor (md, url); } else { diff --git a/mail/mail-local.c b/mail/mail-local.c index 9d7b022617..010ea12eec 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -1120,9 +1120,12 @@ non_hash (gconstpointer key) } static gint -non_equal (gconstpointer a, gconstpointer b) +non_equal (gconstpointer ap, gconstpointer bp) { - return TRUE; + const CamelURL *a = ap, *b = bp; + + return strcmp(a->protocol, "file") == 0 + && strcmp(a->protocol, b->protocol) == 0; } static void |