Skip to content

Commit

Permalink
Use the Thunderbird signature API
Browse files Browse the repository at this point in the history
  • Loading branch information
kam193 committed Nov 13, 2021
1 parent d0dcbe3 commit 80b6f1e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 74 deletions.
3 changes: 2 additions & 1 deletion signature-extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ async function syncAccounts() {
try {
let signature = await getUserSignature(syncable);
let account = await browser.accounts.get(account_id);
await browser.signatureApi.setSignatureHTML(account.identities[0].id, signature);
let identity = {signature: signature, signatureIsPlainText: false};
await browser.identities.update(account.identities[0].id, identity);
syncable.lastSync = new Date();
syncable.lastError = null;
} catch (error) {
Expand Down
8 changes: 8 additions & 0 deletions signature-extension/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ <h1>Welcome in the new version of Signature sync for Gmail!</h1>
only on first use and major changes, but you can always access it in add-on's preferences.
</p>

<h2>Version 2.1.0</h2>
<ul>
<li>
Moving into official identity API in Thunderbid, as so the extension doesn't need the full
permissions anymore. <i>Requires Thunderbird 91 or newer.</i>
</li>
</ul>

<h2>Version 2.0.0</h2>
<ul>
<li>
Expand Down
23 changes: 0 additions & 23 deletions signature-extension/implementation.js

This file was deleted.

15 changes: 3 additions & 12 deletions signature-extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Signature sync for Gmail",
"version": "2.0.2",
"version": "2.1.0",
"author": "Kamil Mańkowski",
"description": "Sync your signatures with Gmail accounts",
"homepage_url": "https://thbrd-signature.kam193.eu/",
Expand All @@ -11,7 +11,7 @@
"applications": {
"gecko": {
"id": "signature-sync@thunderbird.extensions.kam193",
"strict_min_version": "78.4.0"
"strict_min_version": "91.0"
}
},
"background": {
Expand All @@ -21,22 +21,13 @@
"accountsRead",
"identity",
"storage",
"accountsIdentities",
"*://www.googleapis.com/*",
"*://oauth2.googleapis.com/*"
],
"options_ui": {
"page": "options.html",
"open_in_tab": false,
"browser_style": true
},
"experiment_apis": {
"signatureApi": {
"schema": "schema.json",
"parent": {
"scopes": ["addon_parent"],
"paths": [["signatureApi"]],
"script": "implementation.js"
}
}
}
}
38 changes: 0 additions & 38 deletions signature-extension/schema.json

This file was deleted.

0 comments on commit 80b6f1e

Please sign in to comment.