diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-08-28 05:21:14 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-08-28 05:21:14 +0800 |
commit | 68a8a866bb4036b6aea03d62634fc27a6fa4c4c4 (patch) | |
tree | 08904dce3d0022d904f5d8a1dab7df8629a878ef /mail | |
parent | 7c5fe3b52c54cf3223edbd2e5870cbc5795b1abc (diff) | |
download | gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.tar gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.tar.gz gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.tar.bz2 gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.tar.lz gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.tar.xz gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.tar.zst gsoc2013-evolution-68a8a866bb4036b6aea03d62634fc27a6fa4c4c4.zip |
Check if we are trying to reply to a message with no From: field, and try
2001-08-27 Jon Trowbridge <trow@ximian.com>
* mail-callbacks.c (mail_generate_reply): Check if we are trying
to reply to a message with no From: field, and try to do something
graceful in that case. (Bug #7028)
* mail-display.c (ebook_callback): Add paranoid checks for the
case of a message with a From: field. (Also maybe bug #7028)
svn path=/trunk/; revision=12490
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 7 | ||||
-rw-r--r-- | mail/mail-display.c | 11 |
3 files changed, 22 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 5aa43e2942..3b31d63576 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-08-27 Jon Trowbridge <trow@ximian.com> + + * mail-callbacks.c (mail_generate_reply): Check if we are trying + to reply to a message with no From: field, and try to do something + graceful in that case. (Bug #7028) + + * mail-display.c (ebook_callback): Add paranoid checks for the + case of a message with a From: field. (Also maybe bug #7028) + 2001-08-27 Iain Holmes <iain@ximian.com> * mail-config-druid.c (druid_finish): Free the list and hash table. diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index a99cde4317..8421921c56 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -660,7 +660,12 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char return NULL; sender = camel_mime_message_get_from (message); - camel_internet_address_get (sender, 0, &name, &address); + if (sender != NULL && camel_address_length (CAMEL_ADDRESS (sender)) > 0) { + camel_internet_address_get (sender, 0, &name, &address); + } else { + name = _("an unknown sender"); + } + date = camel_mime_message_get_date (message, NULL); strftime (date_str, sizeof (date_str), _("On %a, %Y-%m-%d at %H:%M, %%s wrote:"), diff --git a/mail/mail-display.c b/mail/mail-display.c index 9a9fe89db6..75bc012a00 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -952,11 +952,14 @@ ebook_callback (EBook *book, const gchar *addr, ECard *card, gpointer data) if (card && md->current_message) { const CamelInternetAddress *from = camel_mime_message_get_from (md->current_message); - const char *md_name, *md_addr; + const char *md_name = NULL, *md_addr = NULL; - if (camel_internet_address_get (from, 0, &md_name, &md_addr) && - !strcmp (addr, md_addr)) - mail_display_load_images (md); + /* We are extra anal, in case we are dealing with some sort of pathological message + w/o a From: header. */ + if (from != NULL && camel_internet_address_get (from, 0, &md_name, &md_addr)) { + if (md_addr != NULL && strcmp (addr, md_addr)) + mail_display_load_images (md); + } } } |