diff options
author | Milan Crha <mcrha@redhat.com> | 2009-12-23 22:23:46 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-12-23 22:23:46 +0800 |
commit | 6df525477e6bbee76f53a989f51f8aace6cd58cf (patch) | |
tree | c17a355dce42e174c0d0cce7e602c78928ef4a22 /calendar/gui | |
parent | 4e56f6cc1120f2bd53a5b01dc2f42deac411d299 (diff) | |
download | gsoc2013-evolution-6df525477e6bbee76f53a989f51f8aace6cd58cf.tar.gz gsoc2013-evolution-6df525477e6bbee76f53a989f51f8aace6cd58cf.tar.zst gsoc2013-evolution-6df525477e6bbee76f53a989f51f8aace6cd58cf.zip |
Bug #342935 - Do not choose disabled accounts for meeting requests
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/itip-utils.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 05157f9e68..7f1e0780d9 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -1205,6 +1205,35 @@ append_cal_attachments (EMsgComposer *composer, g_slist_free (attach_list); } +static EAccount * +find_enabled_account (EAccountList *accounts, const gchar *id_address) +{ + EIterator *it; + EAccount *account = NULL; + + g_return_val_if_fail (accounts != NULL, NULL); + + if (!id_address) + return NULL; + + for (it = e_list_get_iterator ((EList *)accounts); + e_iterator_is_valid (it); + e_iterator_next (it)) { + account = (EAccount *)e_iterator_get (it); + + if (account + && account->enabled + && account->id + && account->id->address + && g_ascii_strcasecmp (account->id->address, id_address) == 0) + break; + + account = NULL; + } + + return account; +} + static void setup_from (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, EComposerHeaderTable *table) { @@ -1220,7 +1249,7 @@ setup_from (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, E 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)); + account = find_enabled_account (accounts, itip_strip_mailto (organizer.value)); } } @@ -1228,7 +1257,7 @@ setup_from (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, E gchar *from = comp_from (method, comp); if (from) - account = (EAccount *) e_account_list_find (accounts, E_ACCOUNT_FIND_ID_ADDRESS, from); + account = find_enabled_account (accounts, from); g_free (from); } |