From 5ef2277203de2771df8664ffa671575294bc85ba Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 4 Feb 2024 15:35:28 +0530 Subject: [PATCH] fix: reply and reply all not working --- frontend/src/components/Activities.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index e430113d..737dd217 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -367,6 +367,7 @@
+ + + +
@@ -1076,15 +1080,26 @@ function reply(email, reply_all = false) { let editor = emailBox.value.editor let message = email.content let recipients = email.recipients.split(',').map((r) => r.trim()) - editor.toEmails = recipients + editor.toEmails = [email.sender] editor.cc = editor.bcc = false editor.ccEmails = [] editor.bccEmails = [] + if (!email.subject.startsWith('Re:')) { + editor.subject = `Re: ${email.subject}` + } + if (reply_all) { let cc = email.cc?.split(',').map((r) => r.trim()) let bcc = email.bcc?.split(',').map((r) => r.trim()) + if (cc?.length) { + recipients = recipients.filter((r) => !cc?.includes(r)) + cc.push(...recipients) + } else { + cc = recipients + } + editor.cc = cc ? true : false editor.bcc = bcc ? true : false