1322
1322
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
1324
dest_node = xmlNewNode (NULL, (xmlChar*)"destination");
1324
dest_node = xmlNewNode (NULL, (xmlChar *)"destination");
1326
1326
str = e_destination_get_name (dest);
1328
xmlNewTextChild (dest_node, NULL, (xmlChar*)"name", (xmlChar*)str);
1328
xmlNewTextChild (dest_node, NULL, (xmlChar *)"name", (xmlChar *) str);
1330
1330
if (!e_destination_is_evolution_list (dest)) {
1331
1331
str = e_destination_get_email (dest);
1333
xmlNewTextChild (dest_node, NULL, (xmlChar*)"email", (xmlChar*)str);
1333
xmlNewTextChild (dest_node, NULL, (xmlChar *)"email", (xmlChar *) str);
1335
1335
GList *iter = dest->priv->list_dests;
1338
1338
EDestination *list_dest = E_DESTINATION (iter->data);
1339
xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar*)"list_entry");
1339
xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar *)"list_entry");
1341
1341
str = e_destination_get_name (list_dest);
1343
1343
xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
1344
xmlNewTextChild (list_node, NULL, (xmlChar*)"name", escaped);
1344
xmlNewTextChild (list_node, NULL, (xmlChar *)"name", escaped);
1345
1345
xmlFree (escaped);
1348
1348
str = e_destination_get_email (list_dest);
1350
1350
xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
1351
xmlNewTextChild (list_node, NULL, (xmlChar*)"email", escaped);
1351
xmlNewTextChild (list_node, NULL, (xmlChar *)"email", escaped);
1352
1352
xmlFree (escaped);
1357
1357
iter = g_list_next (iter);
1360
xmlNewProp (dest_node, (xmlChar*)"is_list", (xmlChar*)"yes");
1361
xmlNewProp (dest_node, (xmlChar*)"show_addresses",
1362
e_destination_list_show_addresses (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
1360
xmlNewProp (dest_node, (xmlChar *)"is_list", (xmlChar *)"yes");
1361
xmlNewProp (dest_node, (xmlChar *)"show_addresses",
1362
e_destination_list_show_addresses (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
1365
1365
str = e_destination_get_source_uid (dest);
1367
1367
xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
1368
xmlNewTextChild (dest_node, NULL, (xmlChar*)"source_uid", escaped);
1368
xmlNewTextChild (dest_node, NULL, (xmlChar *)"source_uid", escaped);
1369
1369
xmlFree (escaped);
1376
xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar*)"card_uid", (xmlChar*)str);
1376
xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar *)"card_uid", (xmlChar *) str);
1377
1377
g_snprintf (buf, 16, "%d", e_destination_get_email_num (dest));
1378
xmlNewProp (uri_node, (xmlChar*)"email_num", (xmlChar*)buf);
1378
xmlNewProp (uri_node, (xmlChar *)"email_num", (xmlChar *) buf);
1381
xmlNewProp (dest_node, (xmlChar*)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
1381
xmlNewProp (dest_node, (xmlChar *)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
1383
xmlNewProp (dest_node, (xmlChar*)"auto_recipient",
1384
e_destination_is_auto_recipient (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
1383
xmlNewProp (dest_node, (xmlChar *)"auto_recipient",
1384
e_destination_is_auto_recipient (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
1386
1386
return dest_node;
1410
1410
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
1411
1411
g_return_val_if_fail (node != NULL, FALSE);
1413
if (strcmp ((gchar *)node->name, "destination"))
1413
if (strcmp ((gchar *) node->name, "destination"))
1416
tmp = (gchar *)xmlGetProp (node, (xmlChar*)"html_mail");
1416
tmp = (gchar *) xmlGetProp (node, (xmlChar *)"html_mail");
1418
1418
html_mail = !strcmp (tmp, "yes");
1422
tmp = (gchar *)xmlGetProp (node, (xmlChar*)"is_list");
1422
tmp = (gchar *) xmlGetProp (node, (xmlChar *)"is_list");
1424
1424
is_list = !strcmp (tmp, "yes");
1428
tmp = (gchar *)xmlGetProp (node, (xmlChar*)"show_addresses");
1428
tmp = (gchar *) xmlGetProp (node, (xmlChar *)"show_addresses");
1430
1430
show_addr = !strcmp (tmp, "yes");
1434
tmp = (gchar *)xmlGetProp (node, (xmlChar*)"auto_recipient");
1434
tmp = (gchar *) xmlGetProp (node, (xmlChar *)"auto_recipient");
1436
1436
auto_recip = !strcmp (tmp, "yes");
1440
1440
node = node->xmlChildrenNode;
1442
if (!strcmp ((gchar *)node->name, "name")) {
1442
if (!strcmp ((gchar *) node->name, "name")) {
1443
1443
tmp = (gchar *) xmlNodeGetContent (node);
1445
1445
name = g_strdup (tmp);
1447
} else if (!is_list && !strcmp ((gchar *)node->name, "email")) {
1447
} else if (!is_list && !strcmp ((gchar *) node->name, "email")) {
1448
1448
tmp = (gchar *) xmlNodeGetContent (node);
1449
1449
g_free (email);
1450
1450
email = g_strdup (tmp);
1452
} else if (is_list && !strcmp ((gchar *)node->name, "list_entry")) {
1452
} else if (is_list && !strcmp ((gchar *) node->name, "list_entry")) {
1453
1453
xmlNodePtr subnode = node->xmlChildrenNode;
1454
1454
gchar *list_name = NULL, *list_email = NULL;
1456
1456
while (subnode) {
1457
if (!strcmp ((gchar *)subnode->name, "name")) {
1457
if (!strcmp ((gchar *) subnode->name, "name")) {
1458
1458
tmp = (gchar *) xmlNodeGetContent (subnode);
1459
1459
g_free (list_name);
1460
1460
list_name = g_strdup (tmp);
1462
} else if (!strcmp ((gchar *)subnode->name, "email")) {
1462
} else if (!strcmp ((gchar *) subnode->name, "email")) {
1463
1463
tmp = (gchar *) xmlNodeGetContent (subnode);
1464
1464
g_free (list_email);
1465
1465
list_email = g_strdup (tmp);
1483
1483
list_dests = g_list_append (list_dests, list_dest);
1485
} else if (!strcmp ((gchar *)node->name, "source_uid")) {
1485
} else if (!strcmp ((gchar *) node->name, "source_uid")) {
1486
1486
tmp = (gchar *) xmlNodeGetContent (node);
1487
1487
g_free (source_uid);
1488
1488
source_uid = g_strdup (tmp);
1490
} else if (!strcmp ((gchar *)node->name, "card_uid")) {
1490
} else if (!strcmp ((gchar *) node->name, "card_uid")) {
1491
1491
tmp = (gchar *) xmlNodeGetContent (node);
1492
1492
g_free (card_uid);
1493
1493
card_uid = g_strdup (tmp);
1496
tmp = (gchar *)xmlGetProp (node, (xmlChar*)"email_num");
1496
tmp = (gchar *) xmlGetProp (node, (xmlChar *)"email_num");
1497
1497
email_num = atoi (tmp);
1656
1656
destv_doc = xmlNewDoc ((xmlChar *) XML_DEFAULT_VERSION);
1657
destv_node = xmlNewNode (NULL, (xmlChar*)"destinations");
1657
destv_node = xmlNewNode (NULL, (xmlChar *)"destinations");
1658
1658
xmlDocSetRootElement (destv_doc, destv_node);
1660
1660
for (i = 0; destv[i]; i++) {
1702
1702
node = destv_doc->xmlRootNode;
1704
if (strcmp ((gchar *)node->name, "destinations"))
1704
if (strcmp ((gchar *) node->name, "destinations"))
1707
1707
node = node->xmlChildrenNode;