if (!TNY_IS_MSG (mime_part)) {
gchar *filepath = NULL;
const gchar *att_filename = tny_mime_part_get_filename (mime_part);
- gchar *extension = NULL;
TnyFsStream *temp_stream = NULL;
- if (att_filename) {
- extension = g_strrstr (att_filename, ".");
- if (extension != NULL)
- extension++;
- }
-
- temp_stream = modest_maemo_utils_create_temp_stream (extension, &filepath);
-
+ temp_stream = modest_maemo_utils_create_temp_stream (att_filename, &filepath);
+
if (temp_stream) {
const gchar *content_type;
content_type = tny_mime_part_get_content_type (mime_part);
modest_platform_activate_file (filepath, content_type);
g_object_unref (temp_stream);
g_free (filepath);
- /* TODO: delete temporary file */
+ /* NOTE: files in the temporary area will be automatically
+ * cleaned after some time if they are no longer in use */
}
} else {
/* message attachment */