WIP new tb91 api test

This commit is contained in:
Ximi1970
2021-08-08 17:34:42 +02:00
parent dedba95d02
commit 3a9c5f8e3f
13 changed files with 70 additions and 17 deletions

View File

@@ -12,7 +12,7 @@ depends=(
'qt5-base'
'gnome-shell-extension-appindicator'
'thunderbird>=68'
'thunderbird<=89'
'thunderbird<=91'
)
makedepends=(
'git'

View File

@@ -12,7 +12,7 @@ depends=(
'qt5-base'
'knotifications'
'thunderbird>=68'
'thunderbird<=89'
'thunderbird<=91'
)
makedepends=(
'git'

View File

@@ -11,7 +11,7 @@ license=(MPL-2.0)
depends=(
'qt5-base'
'thunderbird>=68'
'thunderbird<=89'
'thunderbird<=91'
)
makedepends=(
'git'

View File

@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 4.1.16), zip, g++, libx11-dev, qt5-qmake, qtbase5-d
Package: systray-x-gnome
Architecture: any
Depends: ${shlibs:Depends}, gnome-shell-extension-appindicator, thunderbird (>= 1:68), thunderbird (<= 1:89)
Depends: ${shlibs:Depends}, gnome-shell-extension-appindicator, thunderbird (>= 1:68), thunderbird (<= 1:91)
Description: SysTray-X is a system tray extension for Thunderbird 68+ (GNOME).
This version is optimized for the GNOME desktop.
The add-on uses the WebExtension API's to control an external system

View File

@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 4.1.16), zip, g++, libx11-dev, qt5-qmake, qtbase5-d
Package: systray-x
Architecture: any
Depends: ${shlibs:Depends}, thunderbird (>= 1:68), thunderbird (<= 1:89)
Depends: ${shlibs:Depends}, thunderbird (>= 1:68), thunderbird (<= 1:91)
Description: SysTray-X is a system tray extension for Thunderbird 68+ (KDE).
This version is optimized for the KDE desktop.
The add-on uses the WebExtension API's to control an external system

View File

@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 4.1.16), zip, g++, libx11-dev, qt5-qmake, qtbase5-d
Package: systray-x-minimal
Architecture: any
Depends: ${shlibs:Depends}, thunderbird (>= 1:68), thunderbird (<= 1:89)
Depends: ${shlibs:Depends}, thunderbird (>= 1:68), thunderbird (<= 1:91)
Description: SysTray-X is a system tray extension for Thunderbird 68+ (non-GNOME,non-KDE).
This version is for non-KDE and non-GNOME desktops.
The add-on uses the WebExtension API's to control an external system

View File

@@ -33,10 +33,10 @@ BuildRequires: pkgconfig(x11)
Requires: gnome-shell-extension-appindicator
%if 0%{?fedora_version} || 0%{?centos_version}
Requires: thunderbird >= 68
Requires: thunderbird <= 89
Requires: thunderbird <= 91
%else
Requires: MozillaThunderbird >= 68
Requires: MozillaThunderbird <= 89
Requires: MozillaThunderbird <= 91
%endif
%description

View File

@@ -34,12 +34,12 @@ BuildRequires: pkgconfig(x11)
BuildRequires: kf5-knotifications-devel
Requires: kf5-knotifications
Requires: thunderbird >= 68
Requires: thunderbird <= 89
Requires: thunderbird <= 91
%else
BuildRequires: knotifications-devel
Requires: libKF5Notifications5
Requires: MozillaThunderbird >= 68
Requires: MozillaThunderbird <= 89
Requires: MozillaThunderbird <= 91
%endif
%description

View File

@@ -32,10 +32,10 @@ BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(x11)
%if 0%{?fedora_version} || 0%{?centos_version}
Requires: thunderbird >= 68
Requires: thunderbird <= 89
Requires: thunderbird <= 91
%else
Requires: MozillaThunderbird >= 68
Requires: MozillaThunderbird <= 89
Requires: MozillaThunderbird <= 91
%endif
%description

View File

@@ -82,6 +82,16 @@ SysTrayX.Messaging = {
// Try to catch the window state
browser.windows.onFocusChanged.addListener(SysTrayX.Window.focusChanged);
// Test new API from TB91
browser.folders.onFolderInfoChanged.addListener(
SysTrayX.Messaging.listenerTest
);
},
listenerTest: function (folder, folderInfo) {
console.debug("Folder: " + JSON.stringify(folder));
console.debug("FolderInfo: " + JSON.stringify(folderInfo));
},
onCloseButton: function () {
@@ -656,7 +666,14 @@ async function start() {
await getIcon();
// Get all accounts
SysTrayX.Messaging.accounts = await browser.accounts.list();
if (SysTrayX.browserInfo.majorVersion < 91) {
SysTrayX.Messaging.accounts = await browser.accounts.list();
} else {
console.debug("Getting accounts with folders");
const includeFolders = true;
SysTrayX.Messaging.accounts = await browser.accounts.list(includeFolders);
}
// Get folder tree
SysTrayX.Messaging.folderTree = getFolderTree(
@@ -670,6 +687,30 @@ async function start() {
// Get the count type
SysTrayX.Messaging.countType = await getCountType();
// Test new API calls TB91
/*
const folder = {
accountId: "account1",
path: "/Inbox",
};
*/
/*
const folder = {
accountId: "account1",
name: "Inbox",
path: "/Inbox",
type: "inbox",
subFolders: [],
};
*/
/*
const mailFolderInfo = await browser.folders.getFolderInfo(folder);
console.debug("MailFolderInfo: " + JSON.stringify(mailFolderInfo));
*/
// Setup the link first
SysTrayX.Link.init();

View File

@@ -460,8 +460,9 @@ async function getFilters() {
console.debug("Checked filters: " + JSON.stringify(newFilters));
return newFilters;
}
// return newFilters;
return filters;
}
function onFiltersError() {
return undefined;

View File

@@ -18,7 +18,18 @@ SysTrayX.Accounts = {
* Be aware that the data is only avaiable inside the callback
*/
getAccounts: async function () {
return await browser.accounts.list();
if (BrowserInfo.version.split(".")[0] < 91) {
return await browser.accounts.list();
} else {
console.debug("Get account with folders");
const includeFolders = true;
const accounts = await browser.accounts.list(includeFolders);
console.debug("Options accounts: " + JSON.stringify(accounts));
return accounts;
}
},
/*

View File

@@ -10,7 +10,7 @@
"gecko": {
"id": "systray-x@Ximi1970",
"strict_min_version": "68.0",
"strict_max_version": "89.*"
"strict_max_version": "91.*"
}
},