aboutsummaryrefslogtreecommitdiffstats
path: root/composer/evolution-composer.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-09-30 22:04:42 +0800
committerDan Winship <danw@src.gnome.org>2002-09-30 22:04:42 +0800
commitc53a336be2122ee410d754a2945afd8461184528 (patch)
tree03ac97bd2262e085063795f57ebccf47f4691998 /composer/evolution-composer.c
parent1dcff68ce6ee20d604a1635d27a9cf443bdfcd0e (diff)
downloadgsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.tar
gsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.tar.gz
gsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.tar.bz2
gsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.tar.lz
gsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.tar.xz
gsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.tar.zst
gsoc2013-evolution-c53a336be2122ee410d754a2945afd8461184528.zip
let the caller set the "From" account too (by name or address).
* Evolution-Composer.idl (setHeaders): let the caller set the "From" account too (by name or address). * evolution-composer.c (impl_Composer_set_headers): Update for that. svn path=/trunk/; revision=18260
Diffstat (limited to 'composer/evolution-composer.c')
-rw-r--r--composer/evolution-composer.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/composer/evolution-composer.c b/composer/evolution-composer.c
index 8f96f98962..f7131ae6ae 100644
--- a/composer/evolution-composer.c
+++ b/composer/evolution-composer.c
@@ -74,6 +74,7 @@ corba_recipientlist_to_destv (const GNOME_Evolution_Composer_RecipientList *cl)
static void
impl_Composer_set_headers (PortableServer_Servant servant,
+ const CORBA_char *from,
const GNOME_Evolution_Composer_RecipientList *to,
const GNOME_Evolution_Composer_RecipientList *cc,
const GNOME_Evolution_Composer_RecipientList *bcc,
@@ -83,15 +84,31 @@ impl_Composer_set_headers (PortableServer_Servant servant,
BonoboObject *bonobo_object;
EvolutionComposer *composer;
EDestination **tov, **ccv, **bccv;
+ const MailConfigAccount *account;
+ const GSList *accounts;
bonobo_object = bonobo_object_from_servant (servant);
composer = EVOLUTION_COMPOSER (bonobo_object);
+ account = mail_config_get_account_by_name (from);
+ if (!account) {
+ accounts = mail_config_get_accounts ();
+ while (accounts) {
+ account = accounts->data;
+ if (!g_strcasecmp (account->id->address, from))
+ break;
+ accounts = accounts->next;
+ }
+ if (!accounts)
+ account = mail_config_get_default_account ();
+ }
+
tov = corba_recipientlist_to_destv (to);
ccv = corba_recipientlist_to_destv (cc);
bccv = corba_recipientlist_to_destv (bcc);
- e_msg_composer_set_headers (composer->composer, NULL, tov, ccv, bccv, subject);
+ e_msg_composer_set_headers (composer->composer, account->name,
+ tov, ccv, bccv, subject);
e_destination_freev (tov);
e_destination_freev (ccv);