aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-12-23 21:56:10 +0800
committerMilan Crha <mcrha@redhat.com>2009-12-23 21:56:10 +0800
commit4e56f6cc1120f2bd53a5b01dc2f42deac411d299 (patch)
tree64aac031e28c22f55ecea6ca1d83d722cc342781 /calendar
parent3b199d9db06045583627660c0b2a9b6419300fb2 (diff)
downloadgsoc2013-evolution-4e56f6cc1120f2bd53a5b01dc2f42deac411d299.tar.gz
gsoc2013-evolution-4e56f6cc1120f2bd53a5b01dc2f42deac411d299.tar.zst
gsoc2013-evolution-4e56f6cc1120f2bd53a5b01dc2f42deac411d299.zip
Bug #372921 - Meeting invites sent from wrong email account
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/itip-utils.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 2f34d33663..05157f9e68 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -1206,7 +1206,7 @@ append_cal_attachments (EMsgComposer *composer,
}
static void
-setup_from (ECalComponentItipMethod method, ECalComponent *comp, EComposerHeaderTable *table)
+setup_from (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, EComposerHeaderTable *table)
{
EAccountList *accounts;
@@ -1214,6 +1214,16 @@ setup_from (ECalComponentItipMethod method, ECalComponent *comp, EComposerHeader
if (accounts) {
EAccount *account = NULL;
+ /* always use organizer's email when user is an organizer */
+ if (itip_organizer_is_user (comp, client)) {
+ ECalComponentOrganizer organizer = {0};
+
+ e_cal_component_get_organizer (comp, &organizer);
+ if (organizer.value != NULL) {
+ account = (EAccount *) e_account_list_find (accounts, E_ACCOUNT_FIND_ID_ADDRESS, itip_strip_mailto (organizer.value));
+ }
+ }
+
if (!account) {
gchar *from = comp_from (method, comp);
@@ -1284,7 +1294,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
composer = e_msg_composer_new ();
table = e_msg_composer_get_header_table (composer);
- setup_from (method, send_comp, table);
+ setup_from (method, send_comp, client, table);
e_composer_header_table_set_subject (table, subject);
e_composer_header_table_set_destinations_to (table, destinations);
@@ -1386,7 +1396,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method,
composer = e_msg_composer_new ();
table = e_msg_composer_get_header_table (composer);
- setup_from (method, send_comp, table);
+ setup_from (method, send_comp, client, table);
e_composer_header_table_set_subject (table, subject);
e_composer_header_table_set_destinations_to (table, destinations);