aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-08-10 06:19:04 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-08-10 06:19:04 +0800
commitce31e66ee69196c0bd641c72097426ba99f2d7d0 (patch)
tree01f299b483a307e9da6943f84ffbd209b710a18f
parent13263cdb400a2cda1b57f96490a43aa53709dbbd (diff)
downloadgsoc2013-evolution-ce31e66ee69196c0bd641c72097426ba99f2d7d0.tar.gz
gsoc2013-evolution-ce31e66ee69196c0bd641c72097426ba99f2d7d0.tar.zst
gsoc2013-evolution-ce31e66ee69196c0bd641c72097426ba99f2d7d0.zip
Get the from address set in the composer, if that fails ONLY THEN get the
2000-08-09 Jeffrey Stedfast <fejj@helixcode.com> * mail-ops.c (composer_send_cb): Get the from address set in the composer, if that fails ONLY THEN get the default from mail config * mail-config.c (mail_config_get_identities): New convenience function for getting a list of the configured identities svn path=/trunk/; revision=4672
-rw-r--r--mail/ChangeLog17
-rw-r--r--mail/mail-config.c8
-rw-r--r--mail/mail-config.h23
-rw-r--r--mail/mail-ops.c29
4 files changed, 51 insertions, 26 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index cd37b902aa..6afe0bc924 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2000-08-09 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * mail-ops.c (composer_send_cb): Get the from address set in the
+ composer, if that fails ONLY THEN get the default from mail config
+
+ * mail-config.c (mail_config_get_identities): New convenience
+ function for getting a list of the configured identities
+
2000-08-09 Dan Winship <danw@helixcode.com>
* mail-display.c (on_object_requested): Support controls as well
@@ -28,11 +36,14 @@
2000-08-09 Not Zed <NotZed@HelixCode.com>
- * mail-autofilter.c (filter_gui_add_from_message): Helper function to add with confirm.
- (rule_match_recipients): Dont set real name if its empty for the filter name.
+ * mail-autofilter.c (filter_gui_add_from_message): Helper function
+ to add with confirm.
+ (rule_match_recipients): Dont set real name if its empty for the
+ filter name.
(rule_match_subject): was cutting ] off mailing list names.
- * message-list.c (on_right_click): Added menu to install vfolders/filters from message.
+ * message-list.c (on_right_click): Added menu to install
+ vfolders/filters from message.
2000-08-09 Not Zed <NotZed@HelixCode.com>
diff --git a/mail/mail-config.c b/mail/mail-config.c
index fa131121bf..b3f8b6ea04 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -391,6 +391,12 @@ mail_config_get_default_identity ()
return (MailConfigIdentity *)config->ids->data;
}
+GSList *
+mail_config_get_identities ()
+{
+ return config->ids;
+}
+
MailConfigService *
mail_config_get_default_source ()
{
@@ -441,3 +447,5 @@ mail_config_fetch (void)
{
return config;
}
+
+
diff --git a/mail/mail-config.h b/mail/mail-config.h
index df46ae4356..fd1c0f3dda 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -68,17 +68,22 @@ void mail_config_read (void);
void mail_config_write (void);
void mail_config_write_on_exit (void);
-/* Accessor functions */
-gboolean mail_config_is_configured (void);
+/* General Accessor functions */
+gboolean mail_config_is_configured (void);
+MailConfig *mail_config_fetch (void);
+gboolean mail_config_send_html (void);
+gboolean mail_config_thread_list (void);
+gint mail_config_paned_size (void);
+void mail_config_set_thread_list (gboolean value);
+void mail_config_set_paned_size (gint size);
+
+/* Identity Accessor functions */
MailConfigIdentity *mail_config_get_default_identity (void);
+GSList *mail_config_get_identities (void);
+
+/* Service Accessor functions */
MailConfigService *mail_config_get_default_source (void);
-MailConfigService *mail_config_get_transport (void);
-gboolean mail_config_send_html (void);
-gboolean mail_config_thread_list (void);
-gint mail_config_paned_size (void);
-void mail_config_set_thread_list (gboolean value);
-void mail_config_set_paned_size (gint size);
-MailConfig *mail_config_fetch (void);
+MailConfigService *mail_config_get_transport (void);
#endif
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 5cc426d2ad..77045cb79d 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -544,7 +544,7 @@ cleanup_send_mail (gpointer userdata)
static void
composer_send_cb (EMsgComposer *composer, gpointer data)
{
- const MailConfigIdentity *id = NULL;
+ const MailConfigIdentity *id = NULL;
static CamelTransport *transport = NULL;
struct post_send_data *psd = data;
rsm_t *info;
@@ -553,14 +553,14 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
CamelException *ex;
CamelMimeMessage *message;
char *name, *addr;
-
+
ex = camel_exception_new ();
-
+
id = mail_config_get_default_identity ();
if (!check_configured() || !id) {
GtkWidget *message;
-
+
message = gnome_warning_dialog_parented (_("You need to configure an identity\n"
"before you can send mail."),
GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (composer),
@@ -568,32 +568,33 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
gnome_dialog_run_and_close (GNOME_DIALOG (message));
return;
}
-
+
+ from = g_strdup (e_msg_composer_hdrs_get_from (E_MSG_COMPOSER_HDRS (composer->hdrs)));
if (!from) {
CamelInternetAddress *ciaddr;
-
+
g_assert (id);
name = id->name;
g_assert (name);
-
+
addr = id->address;
g_assert (addr);
-
+
ciaddr = camel_internet_address_new ();
camel_internet_address_add (ciaddr, name, addr);
from = camel_address_encode (CAMEL_ADDRESS (ciaddr));
}
-
+
if (!transport) {
MailConfigService *t;
char *url;
-
+
t = mail_config_get_transport ();
url = t->url;
g_assert (url);
-
+
transport = camel_session_get_transport (session, url, ex);
if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) {
mail_exception_dialog ("Could not load mail transport",
@@ -602,9 +603,9 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
return;
}
}
-
+
message = e_msg_composer_get_message (composer);
-
+
subject = camel_mime_message_get_subject (message);
if (!subject || !*subject) {
if (!ask_confirm_for_empty_subject (composer)) {
@@ -612,7 +613,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
return;
}
}
-
+
info = g_new0 (rsm_t, 1);
info->composer = composer;
info->transport = transport;