diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-10-28 04:28:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-10-28 04:28:14 +0800 |
commit | 78a43af4b23250dc56e4a971915f274ab0da377d (patch) | |
tree | 45e65a3a5650dd7108b134f1d69c406995006407 | |
parent | aa1f58529889df10d729e01c02e3922e2dced77a (diff) | |
download | gsoc2013-evolution-78a43af4b23250dc56e4a971915f274ab0da377d.tar.gz gsoc2013-evolution-78a43af4b23250dc56e4a971915f274ab0da377d.tar.zst gsoc2013-evolution-78a43af4b23250dc56e4a971915f274ab0da377d.zip |
Check to make sure that the recipient list is neither NULL nor a 0-length
2000-10-27 Jeffrey Stedfast <fejj@helixcode.com>
* mail-callbacks.c (composer_send_cb): Check to make sure that the
recipient list is neither NULL nor a 0-length list of addresses
and pop up a dialog letting the user know why we are not allowing
him/her to send the message.
svn path=/trunk/; revision=6238
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 13 |
2 files changed, 19 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index ff4045b2ac..d1fd7fb6c7 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2000-10-27 Jeffrey Stedfast <fejj@helixcode.com> + + * mail-callbacks.c (composer_send_cb): Check to make sure that the + recipient list is neither NULL nor a 0-length list of addresses + and pop up a dialog letting the user know why we are not allowing + him/her to send the message. + 2000-10-26 Dan Winship <danw@helixcode.com> * mail-display.c (write_data_to_file): Don't destroy a dialog diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 8cd61f0557..306b4e2003 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -272,6 +272,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data) { MailConfigService *xport = NULL; CamelMimeMessage *message; + const CamelInternetAddress *iaddr; const char *subject; struct post_send_data *psd = data; @@ -282,7 +283,17 @@ composer_send_cb (EMsgComposer *composer, gpointer data) message = e_msg_composer_get_message (composer); /* Check for no recipients */ - if (!camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO)) { + iaddr = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); + if (!iaddr || CAMEL_ADDRESS (iaddr)->addresses->len == 0) { + GtkWidget *message_box; + + message_box = gnome_message_box_new (_("You must specify recipients in order to send this message."), + GNOME_MESSAGE_BOX_WARNING, + GNOME_STOCK_BUTTON_OK, + NULL); + + gnome_dialog_run_and_close (GNOME_DIALOG (message_box)); + camel_object_unref (CAMEL_OBJECT (message)); return; } |