guint32 item_status, status_flags = 0;
CamelFolderChangeInfo *changes = NULL;
gboolean exists = FALSE;
- GString *str = g_string_new (NULL);
+ GString *str_to = g_string_new (NULL);
+ GString *str_cc = g_string_new (NULL);
const gchar *priority = NULL;
gchar *container_id = NULL;
gboolean is_junk = FALSE;
org = e_gw_item_get_organizer (item);
mi->info.from = get_from_from_org (org);
- g_string_truncate (str, 0);
+ g_string_truncate (str_to, 0);
+ g_string_truncate (str_cc, 0);
recp_list = e_gw_item_get_recipient_list (item);
if (recp_list) {
GSList *rl;
- gint i = 0;
+ gint i_to = 0, i_cc = 0;
for (rl = recp_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
- if (i)
- str = g_string_append (str, ", ");
- g_string_append_printf (str,"%s <%s>", recp->display_name, recp->email);
- i++;
+ if (i_to)
+ str_to = g_string_append (str_to, ", ");
+ g_string_append_printf (str_to,"%s <%s>", recp->display_name, recp->email);
+ i_to++;
+ } else if (recp->type == E_GW_ITEM_RECIPIENT_CC) {
+ if (i_cc)
+ str_cc = g_string_append (str_cc, ", ");
+ g_string_append_printf (str_cc,"%s <%s>", recp->display_name, recp->email);
+ i_cc++;
}
}
if (exists)
camel_pstring_free(mi->info.to);
- mi->info.to = camel_pstring_strdup (str->str);
- g_string_truncate (str, 0);
+ mi->info.to = camel_pstring_strdup (str_to->str);
+ mi->info.cc = camel_pstring_strdup (str_cc->str);
+
+ g_string_truncate (str_to, 0);
+ g_string_truncate (str_cc, 0);
}
if (type == E_GW_ITEM_TYPE_APPOINTMENT
}
camel_operation_end (NULL);
g_free (container_id);
- g_string_free (str, TRUE);
+ g_string_free (str_to, TRUE);
+ g_string_free (str_cc, TRUE);
groupwise_sync_summary (folder, error);
camel_folder_changed (folder, changes);
CamelFolderChangeInfo *changes = NULL;
CamelStore *parent_store;
gboolean exists = FALSE;
- GString *str = g_string_new (NULL);
+ GString *str_to = g_string_new (NULL);
+ GString *str_cc = g_string_new (NULL);
const gchar *priority = NULL;
gchar *container_id = NULL;
gboolean is_junk = FALSE;
org = e_gw_item_get_organizer (item);
mi->info.from = get_from_from_org (org);
- g_string_truncate (str, 0);
+ g_string_truncate (str_to, 0);
+ g_string_truncate (str_cc, 0);
recp_list = e_gw_item_get_recipient_list (item);
if (recp_list) {
GSList *rl;
- gint i = 0;
+ gint i_to = 0, i_cc = 0;
for (rl = recp_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
- if (i)
- str = g_string_append (str, ", ");
- g_string_append_printf (str,"%s <%s>", recp->display_name, recp->email);
- i++;
+ if (i_to)
+ str_to = g_string_append (str_to, ", ");
+ g_string_append_printf (str_to,"%s <%s>", recp->display_name, recp->email);
+ i_to++;
+ } else if (recp->type == E_GW_ITEM_RECIPIENT_CC) {
+ if (i_cc)
+ str_cc = g_string_append (str_cc, ", ");
+ g_string_append_printf (str_cc,"%s <%s>", recp->display_name, recp->email);
+ i_cc++;
}
}
- mi->info.to = camel_pstring_strdup (str->str);
- g_string_truncate (str, 0);
+ mi->info.to = camel_pstring_strdup (str_to->str);
+ mi->info.cc = camel_pstring_strdup (str_cc->str);
+
+ g_string_truncate (str_to, 0);
+ g_string_truncate (str_cc, 0);
}
if (type == E_GW_ITEM_TYPE_APPOINTMENT ||
exists = FALSE;
}
g_free (container_id);
- g_string_free (str, TRUE);
+ g_string_free (str_to, TRUE);
+ g_string_free (str_cc, TRUE);
camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);