Now attachments URI's are properly escaped before transmitting them through DBus
{
if (!attachments)
return NULL;
-
+
gchar *attachments_str = g_strdup("");
-
+
GSList *iter = attachments;
while (iter)
{
if (iter->data) {
- gchar *tmp = g_strconcat(attachments_str, ",", (gchar *) (iter->data), NULL);
+ gchar *escaped;
+ gchar *tmp;
+ escaped = g_uri_escape_string ((const gchar *) (iter->data), NULL, TRUE);
+ tmp = g_strconcat(attachments_str, ",", escaped, NULL);
+ g_free(escaped);
g_free(attachments_str);
attachments_str = tmp;
}
-
iter = g_slist_next(iter);
}
-
return attachments_str;
}
-
+
/**
* libmodest_dbus_client_mail_to:
* @osso_context: a valid #osso_context_t object.
gchar **list = g_strsplit(idle_data->attachments, ",", 0);
gint i = 0;
for (i=0; list[i] != NULL; i++) {
- attachments = g_slist_append(attachments, g_strdup(list[i]));
+ attachments = g_slist_append(attachments, g_uri_unescape_string (list[i], NULL));
}
g_strfreev(list);
}
/* Call the function in libmodest-dbus-client: */
- attachments = g_slist_append(attachments, "file:///usr/include/math.h,file:///usr/include/glib-2.0/glib.h");
+ attachments = g_slist_append(attachments, "file:///usr/include/math.h");
+ attachments = g_slist_append(attachments, "file:///usr/include/glib-2.0/glib.h");
+ attachments = g_slist_append(attachments, "file:///tmp/file,coma.txt");
const gboolean ret = libmodest_dbus_client_compose_mail (
osso_context,