From ee2bc048305c045afe341f0611e2b95e5b4fb494 Mon Sep 17 00:00:00 2001
From: Cyrille Bollu <cyr.debian@bollu.be>
Date: Tue, 9 Mar 2021 12:33:52 +0100
Subject: [PATCH] Adds "Reply to All" to MenuEnvelope.

Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
---
 src/components/MenuEnvelope.vue   | 27 ++++++++++++++++++++++-----
 src/components/ThreadEnvelope.vue |  1 +
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/components/MenuEnvelope.vue b/src/components/MenuEnvelope.vue
index 007401af4..3a182fee9 100644
--- a/src/components/MenuEnvelope.vue
+++ b/src/components/MenuEnvelope.vue
@@ -5,6 +5,12 @@
 			menu-align="right"
 			event=""
 			@click.native.prevent>
+			<ActionRouter v-if="withReply"
+				:icon="hasMultipleRecipients ? 'icon-reply-all' : 'icon-reply'"
+				:close-after-click="true"
+				:to="hasMultipleRecipients ? replyAllLink : replyOneLink">
+				{{ t('mail', 'Reply') }}
+			</ActionRouter>
 			<ActionRouter v-if="hasMultipleRecipients"
 				icon="icon-reply"
 				:close-after-click="true"
@@ -134,24 +140,35 @@ export default {
 		MoveModal,
 	},
 	props: {
-		envelope: { // The envelope on which this menu will act
+		envelope: {
+			// The envelope on which this menu will act
 			type: Object,
 			required: true,
 		},
-		mailbox: { // It is just used to get the accountId when envelope doesn't have it
+		mailbox: {
+			// It is just used to get the accountId when envelope doesn't have it
 			type: Object,
 			required: false,
 			default: undefined,
 		},
-		isSelected: { // Indicates if the envelope is currently selected
+		isSelected: {
+			// Indicates if the envelope is currently selected
 			type: Boolean,
 			default: false,
 		},
-		withSelect: { // "Select" action should only appear in envelopes from the envelope list
+		withReply: {
+			// "Reply" action should only appear in envelopes from the envelope list
+			// (Because in thread envelopes, this action is already set as primary button of this menu)
+			type: Boolean,
+			default: true,
+		},
+		withSelect: {
+			// "Select" action should only appear in envelopes from the envelope list
 			type: Boolean,
 			default: true,
 		},
-		withShowSource: { // "Show source" action should only appear in thread envelopes
+		withShowSource: {
+			// "Show source" action should only appear in thread envelopes
 			type: Boolean,
 			default: true,
 		},
diff --git a/src/components/ThreadEnvelope.vue b/src/components/ThreadEnvelope.vue
index 9ec337783..f8dbb5e14 100644
--- a/src/components/ThreadEnvelope.vue
+++ b/src/components/ThreadEnvelope.vue
@@ -66,6 +66,7 @@
 				</router-link>
 				<MenuEnvelope class="app-content-list-item-menu"
 					:envelope="envelope"
+					:with-reply="false"
 					:with-select="false"
 					:with-show-source="true" />
 			</div>
-- 
GitLab