[tracker/gdbus] plugins/evolution: Fix E-mail urn for Evolution E-mails
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/gdbus] plugins/evolution: Fix E-mail urn for Evolution E-mails
- Date: Thu, 28 Oct 2010 12:11:42 +0000 (UTC)
commit acfd0410f2282aeba600bf81872a0767f48499cf
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Oct 28 10:57:19 2010 +0200
plugins/evolution: Fix E-mail urn for Evolution E-mails
src/plugins/evolution/tracker-evolution-plugin.c | 49 ++++++++++++----------
1 files changed, 27 insertions(+), 22 deletions(-)
---
diff --git a/src/plugins/evolution/tracker-evolution-plugin.c b/src/plugins/evolution/tracker-evolution-plugin.c
index 26b3c1b..6637756 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.c
+++ b/src/plugins/evolution/tracker-evolution-plugin.c
@@ -443,41 +443,46 @@ send_sparql_commit (TrackerEvolutionPlugin *self, gboolean update)
static void
add_contact (TrackerSparqlBuilder *sparql, const gchar *predicate, const gchar *uri, const gchar *value)
{
- gchar *email_uri, *email = NULL, *fullname = NULL;
+ gchar *email = NULL, *fullname = NULL;
get_email_and_fullname (value, &email, &fullname);
- email_uri = tracker_sparql_escape_uri_printf ("mailto:%s", email);
+ if ((email && g_utf8_validate (email, -1, NULL)) && (fullname && g_utf8_validate (fullname, -1, NULL))) {
+ gchar *email_uri;
- tracker_sparql_builder_subject_iri (sparql, email_uri);
- tracker_sparql_builder_predicate (sparql, "a");
- tracker_sparql_builder_object (sparql, "nco:EmailAddress");
+ email_uri = g_strdup_printf ("mailto:%s", email);
- tracker_sparql_builder_subject_iri (sparql, email_uri);
- tracker_sparql_builder_predicate (sparql, "nco:emailAddress");
- tracker_sparql_builder_object_string (sparql, email);
+ tracker_sparql_builder_subject_iri (sparql, email_uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nco:EmailAddress");
- tracker_sparql_builder_subject_iri (sparql, uri);
- tracker_sparql_builder_predicate (sparql, predicate);
+ tracker_sparql_builder_subject_iri (sparql, email_uri);
+ tracker_sparql_builder_predicate (sparql, "nco:emailAddress");
+ tracker_sparql_builder_object_string (sparql, email);
- tracker_sparql_builder_object_blank_open (sparql);
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, predicate);
- tracker_sparql_builder_predicate (sparql, "a");
- tracker_sparql_builder_object (sparql, "nco:Contact");
+ tracker_sparql_builder_object_blank_open (sparql);
- if (fullname) {
- tracker_sparql_builder_predicate (sparql, "nco:fullname");
- tracker_sparql_builder_object_string (sparql, fullname);
- g_free (fullname);
- }
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nco:Contact");
- tracker_sparql_builder_predicate (sparql, "nco:hasEmailAddress");
- tracker_sparql_builder_object_iri (sparql, email_uri);
+ if (fullname) {
+ tracker_sparql_builder_predicate (sparql, "nco:fullname");
+ tracker_sparql_builder_object_string (sparql, fullname);
+ }
+
+ tracker_sparql_builder_predicate (sparql, "nco:hasEmailAddress");
+ tracker_sparql_builder_object_iri (sparql, email);
- tracker_sparql_builder_object_blank_close (sparql);
+ tracker_sparql_builder_object_blank_close (sparql);
+ g_free (email_uri);
+ }
- g_free (email_uri);
g_free (email);
+ g_free (fullname);
+
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]