Skip to content

Commit

Permalink
pr reviews: correctly set references header
Browse files Browse the repository at this point in the history
  • Loading branch information
martgil committed Nov 30, 2024
1 parent e59f3b8 commit 0c1633b
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
const msgId = inReplyToMessage.payload?.headers?.find(header => header.name === 'Message-Id' || header.name === 'Message-ID')?.value;
const references = inReplyToMessage.payload?.headers?.find(header => header.name === 'References')?.value;
if (msgId && references) {
this.view.sendBtnModule.additionalMsgHeaders['In-Reply-To'] = msgId;
this.view.sendBtnModule.additionalMsgHeaders.References = references + ' ' + msgId;
this.setReplyHeaders(msgId, references);
}
}
this.view.replyParams.subject = `${this.responseMethod === 'reply' ? 'Re' : 'Fwd'}: ${this.view.replyParams.subject}`;
Expand All @@ -120,8 +119,7 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
);
if (this.view.quoteModule.messageToReplyOrForward) {
const msgId = this.view.quoteModule.messageToReplyOrForward.headers['message-id'];
this.view.sendBtnModule.additionalMsgHeaders['In-Reply-To'] = msgId;
this.view.sendBtnModule.additionalMsgHeaders.References = this.view.quoteModule.messageToReplyOrForward.headers.references + ' ' + msgId;
this.setReplyHeaders(msgId, this.view.quoteModule.messageToReplyOrForward.headers.references);
if (this.view.replyPubkeyMismatch) {
await this.renderReplyMsgAsReplyPubkeyMismatch();
} else if (this.view.quoteModule.messageToReplyOrForward.isOnlySigned) {
Expand Down Expand Up @@ -276,6 +274,13 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
}
};

private setReplyHeaders = (msgId?: string, references?: string) => {
if (msgId) {
this.view.sendBtnModule.additionalMsgHeaders['In-Reply-To'] = msgId;
this.view.sendBtnModule.additionalMsgHeaders.References = [references, msgId].filter(Boolean).join(' ');
}
};

private initComposeBoxStyles = () => {
if (this.view.isReplyBox) {
this.view.S.cached('body').addClass('reply_box');
Expand Down

0 comments on commit 0c1633b

Please sign in to comment.