fix(signatures): apply reply signature to replies and forwards
Publish Docker Image / prepare (push) Successful in 3s
Publish Docker Image / build (linux/amd64, ubuntu-latest) (push) Failing after 19s
Publish Docker Image / build (linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Publish Docker Image / merge (push) Canceled after 0s
Publish Docker Image / prepare (push) Successful in 3s
Publish Docker Image / build (linux/amd64, ubuntu-latest) (push) Failing after 19s
Publish Docker Image / build (linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Publish Docker Image / merge (push) Canceled after 0s
This commit is contained in:
@@ -61,6 +61,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { FilePreviewModal } from "@/components/files/file-preview-modal";
|
||||
import { isFilePreviewable } from "@/lib/file-preview";
|
||||
import { appendHtmlSignature, appendPlainTextSignature } from "@/lib/signature-utils";
|
||||
import { useSignatureStore } from "@/stores/signature-store";
|
||||
import { computeReplyThreadingHeaders } from "@/lib/email-threading";
|
||||
import { EML_IMPORT_ACCEPT, expandImportableEmails } from "@/lib/eml-import";
|
||||
import { findDraftIdentityId, resolveReplyFrom, type ReplyFromResolution } from "@/lib/reply-identity";
|
||||
@@ -2615,8 +2616,16 @@ export default function Home() {
|
||||
|
||||
// Append signature from the sending identity (fall back to primary
|
||||
// when the reply-from lives on the same identity but a different alias).
|
||||
// The signature store's reply signature takes precedence over the legacy
|
||||
// identity signature, matching the composer's send path.
|
||||
const signatureStore = useSignatureStore.getState();
|
||||
const replySigId = signatureStore.getIdentityReplySignatureId(sendingIdentity?.id ?? '');
|
||||
const replySig = replySigId ? signatureStore.getSignatureById(replySigId) : undefined;
|
||||
const signatureSource = replySig
|
||||
? { htmlSignature: replySig.body, textSignature: replySig.plainText }
|
||||
: sendingIdentity;
|
||||
const separator = useSettingsStore.getState().signatureSeparatorEnabled;
|
||||
const finalBody = appendPlainTextSignature(body, sendingIdentity, { separator });
|
||||
const finalBody = appendPlainTextSignature(body, signatureSource, { separator });
|
||||
|
||||
// When the identity has an HTML signature, send a matching HTML body so the
|
||||
// signature keeps its formatting; appendPlainTextSignature would otherwise
|
||||
@@ -2627,8 +2636,8 @@ export default function Home() {
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/\n/g, '<br>');
|
||||
const finalHtmlBody = sendingIdentity?.htmlSignature?.trim()
|
||||
? appendHtmlSignature(`<div>${escapedBody}</div>`, sendingIdentity, { separator })
|
||||
const finalHtmlBody = signatureSource?.htmlSignature?.trim()
|
||||
? appendHtmlSignature(`<div>${escapedBody}</div>`, signatureSource, { separator })
|
||||
: undefined;
|
||||
|
||||
const originalEmailId = selectedEmail.id;
|
||||
|
||||
Reference in New Issue
Block a user