-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Replace experimental API functions with APIs that Thunderbird …
…now supplies.
- Loading branch information
Showing
8 changed files
with
35 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,9 +228,6 @@ var conversations = class extends ExtensionCommon.ExtensionAPI { | |
} | ||
return msgHdr.folder.getUriForMsg(msgHdr); | ||
}, | ||
async formatFileSize(size) { | ||
return messenger.formatFileSize(size); | ||
}, | ||
async createTab(createTabProperties) { | ||
const params = { | ||
url: createTabProperties.url, | ||
|
@@ -671,36 +668,6 @@ var conversations = class extends ExtensionCommon.ExtensionAPI { | |
}) | ||
); | ||
}, | ||
/** | ||
* Wraps the low-level header parser stuff. | ||
* | ||
* @param {string} mimeLine | ||
* A line that looks like "John <[email protected]>, Jane <[email protected]>" | ||
* @returns {Array} | ||
* A list of { email, name, fullName } objects | ||
*/ | ||
parseMimeLine(mimeLine) { | ||
if (mimeLine == null) { | ||
console.warn("Empty aMimeLine?!!"); | ||
return [{ email: "", name: "-", fullName: "-" }]; | ||
} | ||
let addresses = | ||
lazy.MailServices.headerParser.parseDecodedHeader(mimeLine); | ||
if (addresses.length) { | ||
return addresses.map((addr) => { | ||
return { | ||
email: addr.email, | ||
name: addr.name, | ||
fullName: addr.toString(), | ||
}; | ||
}); | ||
} | ||
return [{ email: "", name: "-", fullName: "-" }]; | ||
}, | ||
convertSnippetToPlainText(accountId, path, text) { | ||
let msgFolder = context.extension.folderManager.get(accountId, path); | ||
return msgFolder.convertMsgSnippetToPlainText(text); | ||
}, | ||
async getAccountOfflineDownload(accountId) { | ||
let account = lazy.MailServices.accounts.getAccount(accountId); | ||
return account?.incomingServer.QueryInterface( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -553,12 +553,11 @@ describe("messageEnricher", () => { | |
}; | ||
}); | ||
t.mock | ||
.method(browser.conversations, "parseMimeLine") | ||
.method(browser.messengerUtilities, "parseMailboxString") | ||
.mock.mockImplementation((line) => [ | ||
{ | ||
email: line, | ||
name: "-", | ||
fullName: "-", | ||
}, | ||
]); | ||
|
||
|
@@ -595,12 +594,11 @@ describe("messageEnricher", () => { | |
}; | ||
}); | ||
t.mock | ||
.method(browser.conversations, "parseMimeLine") | ||
.method(browser.messengerUtilities, "parseMailboxString") | ||
.mock.mockImplementation((line) => [ | ||
{ | ||
email: line, | ||
name: "-", | ||
fullName: "-", | ||
}, | ||
]); | ||
|
||
|
@@ -622,7 +620,6 @@ describe("messageEnricher", () => { | |
{ | ||
email: "[email protected]", | ||
name: "-", | ||
fullName: "-", | ||
}, | ||
]); | ||
}); | ||
|