Skip to content

Commit 55d7e62

Browse files
committed
pr review: cleanup
1 parent 35a4663 commit 55d7e62

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { KeyUtil } from '../../../common/core/crypto/key.js';
99
import { DecryptError, DecryptErrTypes, MsgUtil, VerifyRes } from '../../../common/core/crypto/pgp/msg-util.js';
1010
import { OpenPGPKey } from '../../../common/core/crypto/pgp/openpgp-key.js';
1111
import { PgpArmor } from '../../../common/core/crypto/pgp/pgp-armor';
12-
import { Catch } from '../../../common/platform/catch';
1312
import { ContactStore } from '../../../common/platform/store/contact-store.js';
1413
import { KeyStore } from '../../../common/platform/store/key-store.js';
1514
import { Xss } from '../../../common/platform/xss.js';
@@ -33,21 +32,19 @@ export class ThunderbirdElementReplacer extends WebmailElementReplacer {
3332
this.acctEmail = (await BrowserMsg.send.bg.await.thunderbirdGetCurrentUser())!;
3433
const emailBodyToParse = $('div.moz-text-plain').text().trim() || $('div.moz-text-html').text().trim() || $('div.moz-text-flowed').text().trim();
3534
const { processableAttachments: fcAttachments, from: signerEmail } = await BrowserMsg.send.bg.await.thunderbirdGetDownloadableAttachment();
36-
if (Catch.isThunderbirdMail()) {
37-
const parsedPubs = (await ContactStore.getOneWithAllPubkeys(undefined, signerEmail))?.sortedPubkeys ?? [];
38-
const verificationPubs = parsedPubs.map(key => KeyUtil.armor(key.pubkey));
39-
if (this.resemblesAsciiArmoredMsg(emailBodyToParse)) {
40-
await this.messageDecrypt(verificationPubs, this.emailBodyFromThunderbirdMail);
41-
} else if (this.resemblesSignedMsg(emailBodyToParse)) {
42-
await this.messageVerify(verificationPubs);
43-
}
44-
if (fcAttachments.length) {
45-
for (const fcAttachment of fcAttachments) {
46-
await this.attachmentUiRenderer(fcAttachment, verificationPubs, emailBodyToParse);
47-
}
35+
const parsedPubs = (await ContactStore.getOneWithAllPubkeys(undefined, signerEmail))?.sortedPubkeys ?? [];
36+
const verificationPubs = parsedPubs.map(key => KeyUtil.armor(key.pubkey));
37+
if (this.resemblesAsciiArmoredMsg(emailBodyToParse)) {
38+
await this.messageDecrypt(verificationPubs, this.emailBodyFromThunderbirdMail);
39+
} else if (this.resemblesSignedMsg(emailBodyToParse)) {
40+
await this.messageVerify(verificationPubs);
41+
}
42+
if (fcAttachments.length) {
43+
for (const fcAttachment of fcAttachments) {
44+
await this.attachmentUiRenderer(fcAttachment, verificationPubs, emailBodyToParse);
4845
}
49-
$('body').show();
5046
}
47+
$('body').show();
5148
};
5249

5350
private messageDecrypt = async (verificationPubs: string[], encryptedData: string | Buf) => {

0 commit comments

Comments
 (0)