- tny_mime_part_construct (mime_part, stream, mime_type, "base64");
+ /* try to get the attachment's size; this may fail for weird
+ * file systems, like obex, upnp... */
+ if (allowed_size != 0 &&
+ info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) {
+ size = info->size;
+ if (size > allowed_size) {
+ g_warning ("%s: attachment too big", __FUNCTION__);
+ modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed"));
+ return 0;
+ }
+ } else
+ g_warning ("%s: could not get attachment size", __FUNCTION__);
+
+ stream = create_stream_for_uri (uri);
+
+ if (stream == NULL) {
+
+ modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed"));
+
+ g_object_unref (mime_part);
+ gnome_vfs_file_info_unref (info);
+ return 0;
+ }