aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-08-26 17:24:49 +0800
committerMilan Crha <mcrha@redhat.com>2011-08-26 17:24:49 +0800
commit857505c202eb9d4567b681808d311dd7f0dd7d0f (patch)
tree718af61314fce07435a8260645985007c850ed58
parent4c7a93d9fd2b08db22a00bcf2477c3b0b87f4da6 (diff)
downloadgsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.tar
gsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.tar.gz
gsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.tar.bz2
gsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.tar.lz
gsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.tar.xz
gsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.tar.zst
gsoc2013-evolution-857505c202eb9d4567b681808d311dd7f0dd7d0f.zip
Bug #655551 - [mail-to-task] Pick organizer based on selected folder's store
-rw-r--r--plugins/mail-to-task/mail-to-task.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 56da9efa7e..ddcd1328d1 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -308,14 +308,21 @@ set_description (ECalComponent *comp, CamelMimeMessage *message)
}
static gchar *
-set_organizer (ECalComponent *comp)
+set_organizer (ECalComponent *comp, CamelFolder *folder)
{
- EAccount *account;
+ EAccount *account = NULL;
const gchar *str, *name;
ECalComponentOrganizer organizer = {NULL, NULL, NULL, NULL};
gchar *res;
- account = e_get_default_account ();
+ if (folder) {
+ CamelStore *store = camel_folder_get_parent_store (folder);
+
+ account = e_get_account_by_uid (camel_service_get_uid (CAMEL_SERVICE (store)));
+ }
+
+ if (!account)
+ account = e_get_default_account ();
if (!account)
return NULL;
@@ -894,7 +901,7 @@ do_mail_to_event (AsyncData *data)
gchar *organizer;
/* set actual user as organizer, to be able to change event's properties */
- organizer = set_organizer (comp);
+ organizer = set_organizer (comp, data->folder);
set_attendees (comp, message, organizer);
g_free (organizer);
}