Allow the message to be sent even if there are no To recipients but only
2001-06-21 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (composer_get_message): Allow the message to be sent even if there are no To recipients but only as long as there are other recipients defined. svn path=/trunk/; revision=10363
This commit is contained in:
committed by
Jeffrey Stedfast
parent
09b9a3a4da
commit
1cb59bd641
@ -1,3 +1,9 @@
|
||||
2001-06-21 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
* mail-callbacks.c (composer_get_message): Allow the message to be
|
||||
sent even if there are no To recipients but only as long as there
|
||||
are other recipients defined.
|
||||
|
||||
2001-06-21 Jason Leach <jleach@ximian.com>
|
||||
|
||||
* component-factory.c (mail_remove_storage): Deregister the
|
||||
@ -6,7 +12,7 @@
|
||||
|
||||
2001-06-20 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* folder-browser.c: More than on accel key is a tad
|
||||
* folder-browser.c: More than one accel key is a tad
|
||||
confusing.
|
||||
|
||||
2001-06-19 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
@ -291,18 +291,29 @@ composer_sent_cb(char *uri, CamelMimeMessage *message, gboolean sent, void *data
|
||||
static CamelMimeMessage *
|
||||
composer_get_message (EMsgComposer *composer)
|
||||
{
|
||||
CamelMimeMessage *message;
|
||||
static char *recipient_type[] = {
|
||||
CAMEL_RECIPIENT_TYPE_TO,
|
||||
CAMEL_RECIPIENT_TYPE_CC,
|
||||
CAMEL_RECIPIENT_TYPE_BCC
|
||||
};
|
||||
const CamelInternetAddress *iaddr;
|
||||
const char *subject;
|
||||
const MailConfigAccount *account;
|
||||
CamelMimeMessage *message;
|
||||
const char *subject;
|
||||
int num_addrs, i;
|
||||
|
||||
message = e_msg_composer_get_message (composer);
|
||||
if (message == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Check for no recipients */
|
||||
iaddr = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
|
||||
if (!iaddr || CAMEL_ADDRESS (iaddr)->addresses->len == 0) {
|
||||
/* Check for recipients */
|
||||
for (num_addrs = 0, i = 0; i < 3 && num_addrs == 0; i++) {
|
||||
iaddr = camel_mime_message_get_recipients (message, recipient_type[i]);
|
||||
num_addrs += iaddr ? camel_address_length (CAMEL_ADDRESS (iaddr)) : 0;
|
||||
}
|
||||
|
||||
/* I'm sensing a lack of love, er, I mean recipients. */
|
||||
if (num_addrs == 0) {
|
||||
GtkWidget *message_box;
|
||||
|
||||
message_box = gnome_message_box_new (_("You must specify recipients in order to "
|
||||
@ -325,7 +336,7 @@ composer_get_message (EMsgComposer *composer)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Add info about the sending account */
|
||||
account = e_msg_composer_get_preferred_account (composer);
|
||||
if (account) {
|
||||
@ -333,7 +344,7 @@ composer_get_message (EMsgComposer *composer)
|
||||
camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", account->transport->url);
|
||||
camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc", account->sent_folder_uri);
|
||||
}
|
||||
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
@ -359,7 +370,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
|
||||
if (!message)
|
||||
return;
|
||||
transport = mail_config_get_default_transport ();
|
||||
|
||||
|
||||
send = g_malloc (sizeof (*send));
|
||||
send->psd = psd;
|
||||
send->composer = composer;
|
||||
|
||||
Reference in New Issue
Block a user