static gboolean button_release_event (GtkWidget *widget, GdkEventButton *event, ModestAttachmentsView *atts_view);
static gboolean key_press_event (GtkWidget *widget, GdkEventKey *event, ModestAttachmentsView *atts_view);
static gboolean focus_out_event (GtkWidget *widget, GdkEventFocus *event, ModestAttachmentsView *atts_view);
static gboolean button_release_event (GtkWidget *widget, GdkEventButton *event, ModestAttachmentsView *atts_view);
static gboolean key_press_event (GtkWidget *widget, GdkEventKey *event, ModestAttachmentsView *atts_view);
static gboolean focus_out_event (GtkWidget *widget, GdkEventFocus *event, ModestAttachmentsView *atts_view);
-static gboolean focus_in_event (GtkWidget *widget, GdkEventFocus *event, ModestAttachmentsView *atts_view);
+static gboolean focus (GtkWidget *widget, GtkDirectionType direction, ModestAttachmentsView *atts_view);
static GtkWidget *get_att_view_at_coords (ModestAttachmentsView *atts_view,
gdouble x, gdouble y);
static void unselect_all (ModestAttachmentsView *atts_view);
static GtkWidget *get_att_view_at_coords (ModestAttachmentsView *atts_view,
gdouble x, gdouble y);
static void unselect_all (ModestAttachmentsView *atts_view);
+ /* If the top mime part is a multipart/related, we don't show the attachments, as they're
+ * embedded images in body */
+ msg_content_type = tny_mime_part_get_content_type (TNY_MIME_PART (priv->msg));
+ if ((msg_content_type != NULL) && !strcasecmp (msg_content_type, "multipart/related")) {
+ gtk_widget_queue_draw (GTK_WIDGET (attachments_view));
+ return;
+ }
+
+
parts = TNY_LIST (tny_simple_list_new ());
tny_mime_part_get_parts (TNY_MIME_PART (priv->msg), parts);
iter = tny_list_create_iterator (parts);
parts = TNY_LIST (tny_simple_list_new ());
tny_mime_part_get_parts (TNY_MIME_PART (priv->msg), parts);
iter = tny_list_create_iterator (parts);
g_signal_connect (G_OBJECT (instance), "motion-notify-event", G_CALLBACK (motion_notify_event), instance);
g_signal_connect (G_OBJECT (instance), "key-press-event", G_CALLBACK (key_press_event), instance);
g_signal_connect (G_OBJECT (instance), "focus-out-event", G_CALLBACK (focus_out_event), instance);
g_signal_connect (G_OBJECT (instance), "motion-notify-event", G_CALLBACK (motion_notify_event), instance);
g_signal_connect (G_OBJECT (instance), "key-press-event", G_CALLBACK (key_press_event), instance);
g_signal_connect (G_OBJECT (instance), "focus-out-event", G_CALLBACK (focus_out_event), instance);
- g_signal_connect (G_OBJECT (instance), "focus-in-event", G_CALLBACK (focus_in_event), instance);
+ g_signal_connect (G_OBJECT (instance), "focus", G_CALLBACK (focus), instance);