If, after moving or deleting a message from the message viewer, no
[modest] / src / modest-ui-actions.c
index a175fb0..ff2d5a3 100644 (file)
@@ -395,11 +395,8 @@ void
 modest_ui_actions_refresh_message_window_after_delete (ModestMsgViewWindow* win)
 {
        /* Close msg view window or select next */
-       if (modest_msg_view_window_last_message_selected (win) &&
-               modest_msg_view_window_first_message_selected (win)) {
-               modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (win));
-       } else if (!modest_msg_view_window_select_next_message (win) &&
-                  !modest_msg_view_window_select_previous_message (win)) {
+       if (!modest_msg_view_window_select_next_message (win) &&
+           !modest_msg_view_window_select_previous_message (win)) {
                gboolean ret_value;
                g_signal_emit_by_name (G_OBJECT (win), "delete-event", NULL, &ret_value);       
        }
@@ -4310,11 +4307,8 @@ move_to_cb (ModestMailOperation *mail_op,
                if (MODEST_IS_MSG_VIEW_WINDOW (object)) {
                        ModestMsgViewWindow *self = MODEST_MSG_VIEW_WINDOW (object);
 
-                       if (modest_msg_view_window_last_message_selected (self) &&
-                           modest_msg_view_window_first_message_selected (self)) {
-                               modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (self));
-                       } else if (!modest_msg_view_window_select_next_message (self) &&
-                                  !modest_msg_view_window_select_previous_message (self)) {
+                       if (!modest_msg_view_window_select_next_message (self) &&
+                           !modest_msg_view_window_select_previous_message (self)) {
                                /* No more messages to view, so close this window */
                                modest_ui_actions_on_close_window (NULL, MODEST_WINDOW(self));
                        }