Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
martgil committed Oct 24, 2024
1 parent 67522cf commit 8c6555a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
5 changes: 1 addition & 4 deletions extension/js/common/browser/browser-msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export namespace Bm {
export type ExpirationCacheDeleteExpired = Promise<void>;
export type ThunderbirdGetDownloadableAttachment = ThunderbirdAttachment[];
export type ThunderbirdGetCurrentUser = string | undefined;
export type ThunderbirdMsgGet = { attachments: messenger.messages.MessageAttachment[]; messagePart: messenger.messages.MessagePart };
export type ThunderbirdOpenPassphraseDialog = Promise<void>;
export type ThunderbirdInitiateAttachmentDownload = Promise<void>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -138,8 +137,7 @@ export namespace Bm {
| ExpirationCacheDeleteExpired
| AjaxGmailAttachmentGetChunk
| ConfirmationResult
| ThunderbirdGetDownloadableAttachment
| ThunderbirdMsgGet;
| ThunderbirdGetDownloadableAttachment;
}

export type AnyRequest =
Expand Down Expand Up @@ -251,7 +249,6 @@ export class BrowserMsg {
BrowserMsg.sendAwait(undefined, 'thunderbirdInitiateAttachmentDownload', bm, true) as Promise<Bm.Res.ThunderbirdInitiateAttachmentDownload>,
thunderbirdGetCurrentUser: () =>
BrowserMsg.sendAwait(undefined, 'thunderbirdGetCurrentUser', undefined, true) as Promise<Bm.Res.ThunderbirdGetCurrentUser>,
thunderbirdMsgGet: () => BrowserMsg.sendAwait(undefined, 'thunderbirdMsgGet', undefined, true) as Promise<Bm.Res.ThunderbirdMsgGet>,
thunderbirdOpenPassphraseDiaglog: (bm: Bm.ThunderbirdOpenPassphraseDialog) =>
BrowserMsg.sendAwait(undefined, 'thunderbirdOpenPassphraseDialog', bm, true) as Promise<Bm.Res.ThunderbirdOpenPassphraseDialog>,
},
Expand Down
1 change: 0 additions & 1 deletion extension/js/service_worker/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ console.info('background.js service worker starting');
BgHandlers.thunderbirdSecureComposeHandler();
await BgHandlers.thunderbirdContentScriptRegistration();
BrowserMsg.bgAddListener('thunderbirdGetCurrentUser', BgHandlers.thunderbirdGetCurrentUserHandler);
BrowserMsg.bgAddListener('thunderbirdMsgGet', BgHandlers.thunderbirdMsgGetHandler);
BrowserMsg.bgAddListener('thunderbirdGetDownloadableAttachment', BgHandlers.thunderbirdGetDownloadableAttachment);
BrowserMsg.bgAddListener('thunderbirdInitiateAttachmentDownload', BgHandlers.thunderbirdInitiateAttachmentDownload);
BrowserMsg.bgAddListener('thunderbirdOpenPassphraseDialog', BgHandlers.thunderbirdOpenPassphraseDialog);
Expand Down
13 changes: 0 additions & 13 deletions extension/js/service_worker/bg-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,6 @@ export class BgHandlers {
return;
};

public static thunderbirdMsgGetHandler = async (): Promise<Bm.Res.ThunderbirdMsgGet> => {
const [tab] = await messenger.tabs.query({ active: true, currentWindow: true });
if (tab.id) {
const message = await messenger.messageDisplay.getDisplayedMessage(tab.id);
if (message?.id) {
const attachments = await messenger.messages.listAttachments(message.id);
const messagePart = await messenger.messages.getFull(message.id);
return { attachments, messagePart };
}
}
return { attachments: [], messagePart: {} as messenger.messages.MessagePart };
};

public static thunderbirdOpenPassphraseDialog = async (r: Bm.ThunderbirdOpenPassphraseDialog): Promise<Bm.Res.ThunderbirdOpenPassphraseDialog> => {
await BgUtils.openExtensionTab(`chrome/elements/passphrase.htm?type=message&parentTabId=0&acctEmail=${r.acctEmail}&longids=${r.longids}`, true);
};
Expand Down

0 comments on commit 8c6555a

Please sign in to comment.