Fix Reply from mainwindow menu and toolbar when mainwindow's
[claws.git] / src / mainwindow.c
index 40fe077d7ba5e97449e14584da8315ca6cf7640b..30376f0b6c17d2819f0b153bfd230fe9878c1671 100644 (file)
@@ -4120,7 +4120,15 @@ static void main_window_reply_cb(GtkAction *gaction, gpointer data)
 
        msginfo_list = summary_get_selection(mainwin->summaryview);
        cm_return_if_fail(msginfo_list != NULL);
-       compose_reply_from_messageview(msgview, msginfo_list, action);
+
+       if (!summary_has_opened_message(mainwin->summaryview)) {
+               compose_reply_from_messageview(NULL, msginfo_list, action);
+       } else if (summary_is_opened_message_selected(mainwin->summaryview)) {
+               compose_reply_from_messageview(msgview, msginfo_list, action);
+       } else {
+               compose_reply_from_messageview(msgview, NULL, action);
+       }
+
        g_slist_free(msginfo_list);
 }