Skip to content

Commit 80aa8b6

Browse files
author
martgil
committed
Merge remote-tracking branch 'origin/master' into issue-5905-add-secure-reply-all-to-gmail-context-menu-live-test
2 parents 8e2e25e + cbc1687 commit 80aa8b6

File tree

6 files changed

+110
-79
lines changed

6 files changed

+110
-79
lines changed

extension/chrome/elements/compose-modules/formatters/encrypted-mail-msg-formatter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ export class EncryptedMsgMailFormatter extends BaseMailFormatter {
181181
{ msgUrl, externalId }: { msgUrl: string; externalId?: string },
182182
signingPrv?: Key
183183
) => {
184-
// encoded as: PGP/MIME-like structure but with attachments as external files due to email size limit (encrypted for pubkeys only)
184+
// encoded as: PGP/MIME-like structure
185185
const msgBody = this.richtext ? { 'text/plain': newMsg.plaintext, 'text/html': newMsg.plainhtml } : { 'text/plain': newMsg.plaintext };
186+
const attachments = await this.view.attachmentsModule.attachment.collectEncryptAttachments(pubs);
186187
// eslint-disable-next-line @typescript-eslint/naming-convention
187-
const pgpMimeNoAttachments = await Mime.encode(msgBody, { Subject: newMsg.subject }, []); // no attachments, attached to email separately
188+
const pgpMimeNoAttachments = await Mime.encode(msgBody, { Subject: newMsg.subject }, attachments);
188189
const { data: pubEncryptedNoAttachments } = await this.encryptDataArmor(Buf.fromUtfStr(pgpMimeNoAttachments), undefined, pubs, signingPrv); // encrypted only for pubs
189190
const emailIntroAndLinkBody = await this.formatPwdEncryptedMsgBodyLink(msgUrl);
190191
return await SendableMsg.createPwdMsg(

extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ export class GmailElementReplacer extends WebmailElementReplacer {
618618
return from ? Str.parseEmail(from) : undefined;
619619
};
620620

621-
private getLastMsgReplyParams = (convoRootEl: JQuery, replyOption?: ReplyOption): FactoryReplyParams => {
622-
return { replyMsgId: this.determineMsgId($(convoRootEl).find(this.sel.msgInner).last()), replyOption };
621+
private getLastMsgReplyParams = (convoRootEl: JQuery, replyOption?: ReplyOption, replyBoxMessageId?: string | null): FactoryReplyParams => {
622+
return { replyMsgId: replyBoxMessageId ?? this.determineMsgId($(convoRootEl).find(this.sel.msgInner).last()), replyOption };
623623
};
624624

625625
private getConvoRootEl = (anyInnerElement: HTMLElement) => {
@@ -645,9 +645,13 @@ export class GmailElementReplacer extends WebmailElementReplacer {
645645
// removing this line will cause unexpected draft creation bug reappear
646646
// https://github.com/FlowCrypt/flowcrypt-browser/issues/5616#issuecomment-1972897692
647647
this.replyOption = undefined;
648+
// Try to get message id from plain reply box
649+
// https://github.com/FlowCrypt/flowcrypt-browser/issues/5906
650+
const replyBoxMessageId = newReplyBoxes[0].closest('.gA.gt')?.previousElementSibling?.getAttribute('data-legacy-message-id');
651+
648652
// cache for subseqent loop runs
649653
const convoRootEl = this.getConvoRootEl(newReplyBoxes[0]);
650-
const replyParams = this.getLastMsgReplyParams(convoRootEl);
654+
const replyParams = this.getLastMsgReplyParams(convoRootEl, undefined, replyBoxMessageId);
651655
if (msgId) {
652656
replyParams.replyMsgId = msgId;
653657
}

package-lock.json

Lines changed: 68 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"@openpgp/web-stream-tools": "^0.1.3",
1010
"@types/chai": "4.3.19",
1111
"@types/chai-as-promised": "7.1.8",
12-
"@types/chrome": "0.0.299",
12+
"@types/chrome": "0.0.300",
1313
"@types/jquery": "3.5.32",
1414
"@types/mailparser": "3.4.5",
1515
"ava": "5.3.1",
@@ -28,14 +28,14 @@
2828
"lint-staged": "^15.4.3",
2929
"mailparser": "3.7.2",
3030
"mkdirp": "3.0.1",
31-
"openpgp": "6.0.1",
31+
"openpgp": "6.1.0",
3232
"pdfjs-dist": "4.10.38",
3333
"prettier": "^3.4.1",
3434
"puppeteer": "24.1.1",
35-
"stylelint": "16.14.0",
35+
"stylelint": "16.14.1",
3636
"stylelint-config-standard": "37.0.0",
3737
"typescript": "5.7.3",
38-
"typescript-eslint": "^8.21.0",
38+
"typescript-eslint": "^8.22.0",
3939
"undici-types": "^7.3.0",
4040
"web-ext": "8.3.0",
4141
"webpack-cli": "^6.0.1"
@@ -45,7 +45,7 @@
4545
"@types/thunderbird-webext-browser": "^127.0.0",
4646
"bootstrap": "4.6.2",
4747
"clipboard": "2.0.11",
48-
"dompurify": "3.2.3",
48+
"dompurify": "3.2.4",
4949
"filesize": "10.1.2",
5050
"iso-8859-2": "1.0.0",
5151
"jquery": "3.7.1",

test/source/mock/google/strategies/send-message-strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const checkForAbsenceofBase64InAttachments = async (attachments: Attachment[]) =
3030
if (typeof encoding !== 'string') {
3131
throw new HttpClientErr(`Error: Content-Transfer-Encoding isn't present in one of the attachments`);
3232
}
33-
if (!['7bit', 'quoted-printable'].includes(encoding)) {
33+
if (!['7bit', 'quoted-printable', 'base64'].includes(encoding)) {
3434
throw new HttpClientErr(`Error: Unexpected Content-Transfer-Encoding: ${encoding}`);
3535
}
3636
}

0 commit comments

Comments
 (0)