diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/component-factory.c | 7 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 24 | ||||
-rw-r--r-- | mail/mail-callbacks.h | 1 |
4 files changed, 31 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index e9008f413a..cd1ef2f6f2 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2002-08-05 Jeffrey Stedfast <fejj@ximian.com> + + * component-factory.c (user_create_new_item_cb): Updated to call + post_to_url if the id is "post". + + * mail-callbacks.c (post_to_url): New function so that we don't + need a FolderBrowser to post a new message. + (post_message): Call post_to_url since they shared so much code. + 2002-08-05 Dan Winship <danw@ximian.com> * mail-callbacks.c (mail_reply): Only reply to all or reply to diff --git a/mail/component-factory.c b/mail/component-factory.c index e291c40bae..5a2651b789 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -825,8 +825,11 @@ user_create_new_item_cb (EvolutionShellComponent *shell_component, if (!strcmp (id, "message")) { send_to_url (NULL); return; - } - + } else if (!strcmp (id, "post")) { + post_to_url (parent_folder_physical_uri); + return; + } + g_warning ("Don't know how to create item of type \"%s\"", id); } diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 49bc245759..53a043c33f 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -1373,22 +1373,15 @@ forward (GtkWidget *widget, gpointer user_data) void -post_message (GtkWidget *widget, gpointer user_data) +post_to_url (const char *url) { - FolderBrowser *fb = FOLDER_BROWSER (user_data); GtkWidget *composer; - char *url; - - if (FOLDER_BROWSER_IS_DESTROYED (fb) || !check_send_configuration (fb)) - return; composer = create_msg_composer (NULL, TRUE, NULL); if (!composer) return; - url = mail_tools_folder_to_url (fb->folder); e_msg_composer_hdrs_set_post_to ((EMsgComposerHdrs *) ((EMsgComposer *) composer)->hdrs, url); - g_free (url); gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); @@ -1399,6 +1392,21 @@ post_message (GtkWidget *widget, gpointer user_data) } void +post_message (GtkWidget *widget, gpointer user_data) +{ + FolderBrowser *fb = FOLDER_BROWSER (user_data); + GtkWidget *composer; + char *url; + + if (FOLDER_BROWSER_IS_DESTROYED (fb) || !check_send_configuration (fb)) + return; + + url = mail_tools_folder_to_url (fb->folder); + post_to_url (url); + g_free (url); +} + +void post_reply (GtkWidget *widget, gpointer user_data) { FolderBrowser *fb = FOLDER_BROWSER (user_data); diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h index b293edc7bb..cc34c3bbd6 100644 --- a/mail/mail-callbacks.h +++ b/mail/mail-callbacks.h @@ -55,6 +55,7 @@ void forward_quoted (GtkWidget *widget, gpointer user_data); void forward_attached (GtkWidget *widget, gpointer user_data); void forward (GtkWidget *widget, gpointer user_data); +void post_to_url (const char *url); void post_message (GtkWidget *widget, gpointer user_data); void post_reply (GtkWidget *widget, gpointer user_data); |