If no header available and we have to show error fetching message, show
[modest] / src / modest-ui-actions.c
index 7d26705..8c65b6c 100644 (file)
@@ -686,9 +686,10 @@ modest_ui_actions_on_close_window (GtkAction *action, ModestWindow *win)
 void
 modest_ui_actions_add_to_contacts (GtkAction *action, ModestWindow *win)
 {
-       g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (win));
-
-       modest_msg_view_window_add_to_contacts (MODEST_MSG_VIEW_WINDOW (win));
+       if (MODEST_IS_MSG_VIEW_WINDOW (win))
+               modest_msg_view_window_add_to_contacts (MODEST_MSG_VIEW_WINDOW (win));
+       else if (MODEST_IS_MSG_EDIT_WINDOW (win))
+               modest_msg_edit_window_add_to_contacts (MODEST_MSG_EDIT_WINDOW (win));
 }
 
 void
@@ -1003,9 +1004,14 @@ modest_ui_actions_msg_retrieval_check (ModestMailOperation *mail_op,
                                if (protocol) {
                                        if (tny_account_get_connection_status (account) ==
                                            TNY_CONNECTION_STATUS_CONNECTED) {
-                                               format = modest_protocol_get_translation (protocol,
-                                                                                         MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE,
-                                                                                         subject);
+                                               if (header) {
+                                                       format = modest_protocol_get_translation (protocol,
+                                                                                                 MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE,
+                                                                                                 subject);
+                                               } else {
+                                                       format = modest_protocol_get_translation (protocol,
+                                                                                                 MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE_LOST_HEADER);
+                                               }
                                        } else {
                                                format = g_strdup_printf (_("mail_ib_backend_server_invalid"),
                                                                          tny_account_get_hostname (account));