aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-30 07:46:55 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-30 07:46:55 +0800
commit424506262d215dfe306aea0d0fe86833d08b82a4 (patch)
treeeb1a374e5b456d1d546b0c0f4b5a4d0d6280a7de /mail/mail-callbacks.c
parentb912dd5436413b55dc4500dd7d2b8afcdd433727 (diff)
downloadgsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.gz
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.bz2
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.lz
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.xz
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.zst
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.zip
Added #include <libgnome/gnome-paper.h>
2001-03-29 Jon Trowbridge <trow@ximian.com> * printing/e-contact-print.c: Added #include <libgnome/gnome-paper.h> * printing/e-contact-print-envelope.c: Added #include <time.h> and #include <libgnome/gnome-paper.h> * gui/component/select-names/e-select-names-completion.c (match_email): Better handle matching of "nameless" contacts. * backend/ebook/e-destination.c (e_destination_get_string): Better handle the case of a "nameless" contact. 2001-03-29 Jon Trowbridge <trow@ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_message): Save the source URL using camel_mime_message_set_source. * camel-mime-message.c (camel_mime_message_set_source): Renamed camel_mime_message_set_identity to this. Sets the X-Evolution-Source header. (camel_mime_message_get_source): Returns the X-Evolution-Source header. 2001-03-29 Jon Trowbridge <trow@ximian.com> * mail-callbacks.c: Added #include <time.h> to get things to compile. * mail-callbacks.c (mail_generate_reply): Look at the X-Evolution-Source header, and try to find a corresponding account. If this works, send the mail from this account. If not, use the default account. * mail-ops.c (send_queue_send): Strip out the X-Evolution-Source header before sending. * mail-config.c (mail_config_get_account_by_source_url): Added. Look up accounts by source URL. svn path=/trunk/; revision=9032
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index dee9791098..0fc6596f88 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -30,10 +30,12 @@
#endif
#include <errno.h>
+#include <time.h>
#include <libgnome/gnome-paper.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-stock.h>
+#include <libgnome/gnome-paper.h>
#include <libgnomeprint/gnome-print-master.h>
#include <libgnomeprint/gnome-print-master-preview.h>
#include <gal/e-table/e-table.h>
@@ -286,7 +288,7 @@ composer_sent_cb(char *uri, CamelMimeMessage *message, gboolean sent, void *data
camel_object_unref (CAMEL_OBJECT (message));
}
-CamelMimeMessage *
+static CamelMimeMessage *
composer_get_message (EMsgComposer *composer)
{
CamelMimeMessage *message;
@@ -558,7 +560,7 @@ static EMsgComposer *
mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
{
const CamelInternetAddress *reply_to, *sender, *to_addrs, *cc_addrs;
- const char *name = NULL, *address = NULL;
+ const char *name = NULL, *address = NULL, *source = NULL;
const char *message_id, *references;
char *text, *subject, *date_str;
const MailConfigAccount *me = NULL;
@@ -569,8 +571,11 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
gchar *sig_file = NULL;
time_t date;
int offset;
+
+ source = camel_mime_message_get_source (message);
+ me = mail_config_get_account_by_source_url (source);
- id = mail_config_get_default_identity ();
+ id = me ? me->id : mail_config_get_default_identity ();
if (id)
sig_file = id->signature;
@@ -607,7 +612,7 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
if (to_all) {
cc = list_add_addresses (cc, to_addrs, accounts, &me);
cc = list_add_addresses (cc, cc_addrs, accounts, me ? NULL : &me);
- } else {
+ } else if (me == NULL) {
me = guess_me (to_addrs, cc_addrs, accounts);
}